×Ö·ûÊäÈëÊä³ö:
aa = getchar();
putchar(a);
¸ñʽÊä³ö:
printf(¸ñʽ¿ØÖÆ, Êä³ö±íÁÐ);
%d Ê®½øÖÆÊý %md mΪָ¶¨µÄ¿í¶È ÈôÊý¾ÝλÊýСÓÚm,Ôò×ó¶Ë²¹ÒÔ¿Õ¸ñ;Èô´óÓÚm,Ôò°´Êµ¼ÊλÊýÊä³ö
%ld ³¤ÕûÐÍÊý¾Ý %mld Ö¸¶¨×ֶοí¶È
%o °Ë½øÖÆÕûÊýÐÎʽ %mo
%x Ê®Áù½øÖÆÕûÊýÐÎʽ %mx
%u unsignedÐÍÊý¾Ý,ËüÒ²¿ÉÓÃ%o»ò%x¸ñʽÊä³ö
%c Ò»¸ö×Ö·û %mc
%s ×Ö·û´® Óм¸ÖÖÓ÷¨
1.%s
printf("%s", "China");
Êä³ö China
2.%ms ¿ØÖÆΪmÁÐ Èô´®³¤Ð¡ÓÚm, Ôò×󲹿ոñ,´óÓÚÔòÍ»ÆÆmÏÞÖÆ,½«×Ö·û´®ÍêÈ«Êä³ö
3.%-ms Èô´®³¤Ð¡ÓÚm, ÔòÓÒ²¹¿Õ¸ñ(¾Ó×ó)
4.%m.ns Êä³öÕ¼mÁÐ,È¡×Ö·û´®×ó¶Ën¸ö×Ö·û.Õân¸ö×Ö·ûÊä³öÔÚmÁеÄÓÒ²à,×󲹿ոñ
5.%-m.ns m.nͬÉÏ,Õân¸ö×Ö·ûÊä³öÔÚmÁеÄ×ó²à,ÓÒ²¹¿Õ¸ñ.Èôn>m,Ôòm×Ô¶¯È¡nÖµ,±£Ö¤n¸ö×Ö·ûÕý³£Êä³ö
%f Êä³öʵÊý(°üÀ¨µ¥.Ë«¾«¶È),ÒÔСÊýÐÎʽÊä³ö
1.%f Êä³öÈ«²¿ÕûÊý²¿·Ö,Êä³ö6λСÊý
2.%m.nf Ö¸¶¨Êä³öµÄÊý¾Ý¹²Õ¼mÁÐ,ÆäÖÐÓÐnλСÊý.ÈôÊýÖµ³¤¶ÈСÓÚm,Ôò×ó¶Ë²¹¿Õ¸ñ
3.%-m.nf Ö¸¶¨Êä³öµÄÊý¾Ý¹²Õ¼mÁÐ,ÆäÖÐÓÐnλСÊý.ÈôÊýÖµ³¤¶ÈСÓÚm,ÔòÓҶ˲¹¿Õ¸ñ
%e ÒÔÖ¸ÊýÐÎʽÊä³öʵÊý
1.%e ²»Ö¸¶¨Êä³öÊý¾ÝËùÕ¼µÄ¿í¶ÈºÍÊý×Ö²¿·ÖµÄСÊýÊýλ,ÊýÖµ°´¹æ·¶»¯Êä³ö
2.%m.ne ºÍ %-m.ne Êä³öÕ¼mÁÐ,nÖ¸Êä³öµÄÊý¾ÝµÄСÊý²¿·Ö(βÊý)µÄСÊýÊýλ,-ͬÉÏ
%g Êä³öʵÊý,¸ù¾ÝÊýÖµ´óС,×Ô¶¯Ñ¡Ôñf¸ñʽ»òÕße¸ñʽ(Ñ¡ÔñÊä³ö¿í¶ÈСµÄ),ÇÒ²»Êä³öÎÞÒâÒåµÄÁã
¸ñʽ¿ØÖÆÖпÉÒÔ°üº¬×ªÒå×Ö·û,Èç'\n' '\t' '\b' '\r'
Êä³ö%µÄ·½·¨ printf("%f%%", 1.0/3) Êä³ö: 0.333333%
¸ñʽÊäÈë
scanf(¸ñʽ¿ØÖÆ, µØÖ·±íÁÐ)
ÀàËÆprintf .ÒÔÀý³Ì½âÊÍ
1. scanf("%3d%3d", &a, &b); //ÁÐÊý½ØÈ¡Êý¾Ý
input -> 123456
then -> a = 123 b = 456
2. scanf("%2d %*3d %2d", &a, &b) //*±íʾÌø¹ýÁÐÊý¶ÁÈ¡Êý¾Ý
input -> 12 345 67
then -> a = 12 b = 67
3. scanf("%d, %d", &a, &b)
input -> 1, 4 //ÔÚ¸ñʽ¿ØÖÆÖÐ,Èç¹ûÓзǸñʽ˵Ã÷ÍâµÄ×Ö·û,Ó¦¸ÃÔÚÊäÈëʱÔÚ¶ÔӦλÖÃÊäÈë¸Ã×Ö·û
scanf("%d %d", &a, &b) //ÊäÈëʱ,Á½Êý¾ÝÓ¦Óв»ÉÙÓÚ¸ñʽ¿ØÖÆÖеĿոñ
scanf("%c%c%c", &
Boss˵£¬Òª¿´OpenGL£¬¿´ÁË¿ìÒ»¸öÔ£¬×ÜËã³öÁ˸öÏñÑùµÄ¶«Î÷£¬ÓÃCдÁ˸ö3DÃÔ¹¬£¬
ËäȻֻÓÐ350ÐÐ
´úÂ룬²»¹ý±ßѧ±ßд£¬×ã×ãдÁËÒ»ÖÜʱ¼ä£¬»¹ÊÇСÓгɾ͸еģ¬»î»î»î£¡
&n ......