Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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()
{


Ïà¹ØÎÊ´ð£º

Á½¸öCÎļþµÄÎÊÌâ

ÒÔǰÔÚVCÀïÃæ½¨Ò»¸ö¹¤³Ì£¬¶¼Ö»ÓÃÒ»¸ö .c Îļþ£¬×òÌìÔÚÒ»¸ö¹¤³ÌÀïÓÃÁËÁ½¸ö .cÎļþÁË£¬Óöµ½ÎÊÌâÁË£¬Çë´ó¼ÒÖ¸µã¡£±ÈÈ磺
File1.c Fil ......

C ³ÌÐòÎÊÌâ (¶þ) - C/C++ / CÓïÑÔ

ÎÊһϣº
#include <stdio.h>
int main()
{
  char x, y, z;
  int i;
  int a[16];
  for(i=0; i<=16; i++)
  {
  a[i] = 0;
  ......

CÁ´±íÎÊÌâ

ÎÒ½¨ÁËÒ»¸ö´øÍ·Ö¸ÕëµÄÁ´±í
Í·Ö¸ÕëL ÄÇôÎÒÏëɾ³ýÁ´±í
free(l);ÊÇɾ³ýÁËÍ·½áµã »¹ÊÇÁ¬ËüµÄÏÂÃæµÄ½áµãÒ²Ò»ÆðɾÁË£¿
free(l)ºó »¹ÓÃȫɾһ±ãÂ𣿣¨´ÓÄÚ´æµÄ½Ç¶È ²»ÊÇ´Ó²éÕҵĽǶȿ¼ÂÇ£©
ɾͷ½Úµã
»Ø´ðÍê±Ï ......

CÁ´±íÎÊÌâ

ÎÒÊäÈë1 µ«Êä³ö²»ÊÇ1 ÎÊÒ»ÏÂÎÒÄÄ´íÁË?Ö÷ÒªÊDzÎÊýµÄ´«µÝ³ö´íÁ衃 µ«ÎÒÔõôҲ¿´²»³öÀ´ ÎÒµÄÊǵØÖ·´«µÝ
#include "stdio.h"
typedef int type;
typedef struct lnode
{
type elem;
stru ......

c/sÏîÄ¿ÖÐÀûÓÃÏß³ÌÈçºÎÅжϿͻ§¶ËµÄµÚÒ»´ÎÇëÇó£¿

ÔÚÏß³ÌÀàÀïÃæ£¬±êʶһÏÂÊÇ·ñÊǵÚÒ»´ÎÇëÇó£¿
ÎÒÒÔǰÓöµ½¹ýÀàËÆµÄÎÊÌ⣬µ±Ê±Êǵã»÷Ñ¡Ïµ¯³öÒ»¸öд°¿Ú£¨ÀàËÆ360£©£¬ÎªÁ˲»²úÉúÖØ¸´µÄ´°¿Ú£¬¼ÓÒ»¸öbooleanÐÍEXIST±äÁ¿£¬±êʾ´°¿ÚÊÇ·ñÒѾ­²úÉú£¬Äã¿ÉÒÔͬÑù¼ÓÒ»¸öÀàËÆµ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ