C primer plus ϰÌâÇó½â
¸ÃÊéµÚËÄÕµÚÎåÌ⣺
Write a program that requests the user's first name and then the user's last name. Have it print the entered names on one line and the number of letters in each name on the following line. Align each letter count with the end of the corresponding name, as in the following:
Melissa Honeybee
7 8
Next, have it print the same information, but with the counts aligned with the beginning of each name.
Melissa Honeybee
7 8
×¢Òâ´ËÊéǰËÄÕ»¹Ã»ÓÐÁ÷³Ì¿ØÖÆÓï¾äµÄ½éÉÜ£¬
Òò´Ë×÷ÕßÓ¦¸Ã²»ÊÇÈÃÎÒÃÇÓÃforÓï¾äÀ´Íê³ÉÕâ¸öÌâÄ¿£»
ÐÂÊÖÇó½â£¡
#include <string.h>
ʹÓÃstrlen(s)¿ÉÒԵõ½×Ö·û´®sµÄ³¤¶È¡£
È»ºóÓ¦¸Ã»á×öÁ˰ɣ¿
´óÏÀ£¬strlenµÃµ½×Ö·û´®µÄ³¤¶È£»
È»ºóÄØ
´ËÊéǰËÄÕ»¹Ã»ÓÐÁ÷³Ì¿ØÖÆÓï¾äµÄ½éÉÜ£¬
Òò´Ë×÷ÕßÓ¦¸Ã²»ÊÇÈÃÎÒÃÇÓÃforÓï¾äÀ´Íê³ÉÕâ¸öÌâÄ¿£»
»¹ÊDz»»á..........
¾Í´òÓ¡³öÀ´±»£¬¼ÈÈ»Äܵõ½ÁË¡£
´òÓ¡µÄλÖþÍÊǺÏÀí¿ØÖÆ¿Õ¸ñ
ÈçºÎ¿ØÖƿոñ£¿
printf("%md",i);
ÕâÑù£¬Èç¹ûiµÄ³¤¶È²»¹»m£¬¾ÍÔÚÇ°Ãæ²¹ÉϿոñ
¼ÈȻѧC++£¬¾ÍÓñê×¼¿â°É
C/C++ code:
#include <string>
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
Ïà¹ØÎÊ´ð£º
#include <string.h>
#include <stdio.h>
void main()
{
int i;
char buf[]="abcde";
strncpy(buf,"abc",3);
for(i=0;i <5;i++)
printf(&q ......
QQȺ 29152388
ÓÑÇéUP
°ï¶¥
up
°ïup
up Ö§³Ö£¡
up jf
...ÄѵÀÓзÖ..?
up up up
Ï£ÍûÓеüӷ֣¬¹þ¹þ¡£
Ö§³Ö£¬ÎÒ¼ÓÁË£¬Ï£ÍûÂ¥Ö÷ÄܼÓÎÒ£¬¹²Í¬Ñ§Ï°¹þ
¼ÓÁË¡£
¶¥ÉÏ£¬Ã¿ÌìÊÕ»ñÒ»µã£¬Ö§³Ö ......
ÎÊһϣº
#include <stdio.h>
int main()
{
char x, y, z;
int i;
int a[16];
for(i=0; i<=16; i++)
{
a[i] = 0;
......
ÎÒÏëÓÒ¼üÊôÐÔÄǸö¿ÉÄܲ»Ðаɣ¿
Çë¸ßÊÖÖ¸µ¼Ï¹þ
ÄãÊÇlinuxÓû§£¿ÔÚVSÀïÃæÊÇÔÚ×ÊÔ´ÎļþÀï¼Óͼ±ê£¬LinuxÀïÓ¦¸ÃÒ²ÓÐÀàËÆµÄ¶«Î÷°É
ʲôϵͳ? Linux»¹ÊÇWindows?
windowsµÄ»°£¬Ç¶Èëλͼµ½×ÊÔ´Àï¾Í¿ÉÒÔÁË
......
×î½üͻȻÏë×Ô¼ºÀ´ÊµÏÖÒ»¸öÎå×ÓÆå³ÌÐò,µ«²»ÖªµÀÔõô¿ªÊ¼,×Ô¼ºÒ²Ã»Ñ§»Í¼Ðκ¯Êý,ÄÜÔÚ¿ØÖÆÌ¨ÏÂÖ±½ÓдÂð>>>?????
¿ØÖÆÌ¨£¿±ÈͼÐνçÃæ¸üÂé·³¡£
http://search.download.csdn.net/search/%E4%BA%94%E5%AD%90% ......