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 ......
µØµãÔÚÉîÛÚÄÏɽ
¡¡¡¡×öCÈí¼þ¡£ÊÔÓÃ2K£¬²»ÖªµÀתÕý¸ø¹«Ë¾Ì¸¶àÉÙºÏÊʰ¡£¿
¡¡¡¡ÁíÍ⣬±¾ÈËС±¾£¬Ó¢ÓïÁù¼¶£¬ÊÔÓÃÈý¸öÔ±íÏÖµÃÒ²ËãÖÐÉÏˮƽ¡£µ«ÊÇÏÖÔÚ»¹²»ÄÜ×öÏîÄ¿¡£ÁíÍâ±ÏҵѧУûÓÐÃûÆø¡£
¡¡¡¡×ªÕý¸ø¹«Ë¾Ì¸¶àÉ ......
ΪʲôCдµÄDLLÎļþC¡¢PBÄܵ÷ÓÃVB²»Äܵ÷Óã¿
VBÀïΪʲôÓеÄDLLÖ±½Óͨ¹ýÒýÓÿÉÒÔʹÓã¿ÓеÄÐèҪͨ¹ýdeclareÉêÃ÷Íⲿº¯Êý£¿ÕâЩDLLÓÐʲô²î±ð£¿
1¡¢ÎªÊ²Ã´PBÄÜͨ¹ýDECLAREÉùÃ÷¶øVB²»ÐУ¿
2¡¢Èç¹ûÕâ¸ödllÖÐµÄ ......
ÎÒÓÃPHPÀ©Õ¹Cʱ£¬ÓõÄÊÇÔ´ÂëextĿ¼ÏµÄ./ext_skel
×îºó±àÒë×ÜÊDz»ÄÜÉú³ÉÀ©Õ¹Ä£¿éµÄ.so¶¯Ì¬¿â£¬ÎÒÓõİ汾ÊÇ5.3.0£¬
ÕâÊÇÔõô»ØÊ£¬¸ßÊÖ½â´ðÏÂ
²»ÄÜÉú³ÉʱÓÐɶÌáʾÐÅÏ¢£¿
ÔËÐÐÁË/ext_skel --extname=Ä ......
#include <iostream.h>
void main(){
int x,y,t=0,b=0;
x=y=0;t=x++&&++y;
cout < <"t=" < <t < <"," < <"x=" < <x &l ......