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 <stdio.h>
#include <graphics.h>
void main()
{
int x0,y0,x1,y1,driver,mode,i;
driver=VGA;
mode=VGAHI;
initgraph(&driver,&mode,&qu ......
ÎÒÓÃPHPÀ©Õ¹Cʱ£¬ÓõÄÊÇÔ´ÂëextĿ¼ÏµÄ./ext_skel
×îºó±àÒë×ÜÊDz»ÄÜÉú³ÉÀ©Õ¹Ä£¿éµÄ.so¶¯Ì¬¿â£¬ÎÒÓõİ汾ÊÇ5.3.0£¬
ÕâÊÇÔõô»ØÊ£¬¸ßÊÖ½â´ðÏÂ
²»ÄÜÉú³ÉʱÓÐɶÌáʾÐÅÏ¢£¿
ÔËÐÐÁË/ext_skel --extname=Ä ......
ÎÊһϣº
#include <stdio.h>
int main()
{
char x, y, z;
int i;
int a[16];
for(i=0; i<=16; i++)
{
a[i] = 0;
......
C/C++ code:
command.h
/* DEFUN for vty command interafce. Little bit hacky ;-). */
#define DEFUN(funcname, cmdname, cmdstr, helpstr) \
int funcname (struct cmd_element *, struct vty *, int, c ......
ÔÚÏß³ÌÀàÀïÃ棬±êʶһÏÂÊÇ·ñÊǵÚÒ»´ÎÇëÇó£¿
ÎÒÒÔÇ°Óöµ½¹ýÀàËƵÄÎÊÌ⣬µ±Ê±Êǵã»÷Ñ¡Ïµ¯³öÒ»¸öд°¿Ú£¨ÀàËÆ360£©£¬ÎªÁ˲»²úÉúÖظ´µÄ´°¿Ú£¬¼ÓÒ»¸öbooleanÐÍEXIST±äÁ¿£¬±êʾ´°¿ÚÊÇ·ñÒѾ²úÉú£¬Äã¿ÉÒÔͬÑù¼ÓÒ»¸öÀàËƵ ......