CÊä³ö¸ñʽ×ܽá
CÊä³ö¸ñʽ×ܽá
2007-07-08 12:09
1 Ò»°ã¸ñʽ
printf(¸ñʽ¿ØÖÆ£¬Êä³ö±íÁУ©
ÀýÈ磺printf("i=%d,ch=%c\n",i,ch);
˵Ã÷:
(1)“¸ñʽ¿ØÖÆ”ÊÇÓÃ˫ƲºÅÀ¨ÆðÀ´µÄ×Ö·û´®£¬Ò²³Æ“ת»»¿ØÖÆ×Ö·û´®”£¬Ëü°üÀ¨Á½ÖÖÐÅÏ¢£º
¢Ù¸ñʽ˵Ã÷£ºÓÉ“%”ºÍ¸ñʽ×Ö·û×é³É£¬ËüµÄ×÷ÓÃÊǽ«Êä³öµÄÊý¾Ýת»»ÎªÖ¸¶¨µÄ¸ñʽÊä³ö¡£
¢ÚÆÕͨ×Ö·û£¬¼´ÐèÒªÔÑùÊä³öµÄ×Ö·û¡£
(2)“Êä³ö±íÁДÊÇÐèÒªÊä³öµÄһЩÊý¾Ý£¬¿ÉÒÔÊDZí´ïʽ
(3) printfº¯ÊýµÄÒ»°ãÐÎʽ¿ÉÒÔ±íʾΪ
printf(²ÎÊý1£¬²ÎÊý2£¬……£¬²ÎÊýn)
¹¦ÄÜÊǽ«²ÎÊý2¡«²ÎÊýn°´²ÎÊý1¸ø¶¨µÄ¸ñʽÊä³ö
2 ¸ñʽ×Ö·û£¨9ÖÖ£©
(1)d£¨»òi£©¸ñʽ·û¡£ÓÃÀ´Êä³öÊ®½øÖÆÕûÊý£¬ÓÐÒÔϼ¸ÖÖÓ÷¨£º
¢Ù%d£¬°´ÕûÐÍÊý¾ÝµÄʵ¼Ê³¤¶ÈÊä³ö¡£
¢Ú%md£¬mΪָ¶¨µÄÊä³ö×ֶεĿí¶È¡£Èç¹ûÊý¾ÝµÄλÊýСÓÚm£¬Ôò×ó¶Ë²¹ÒÔ¿Õ¸ñ£¬Èô´óÓÚm£¬Ôò°´Êµ¼ÊλÊýÊä³ö¡£
¢Û%ld(%mld Ò²¿É)£¬Êä³ö³¤ÕûÐÍÊý¾Ý¡£
ÀýÈ磺long a=123456;
printf("%ld",a);
¡¡(2)o¸ñʽ·û£¬Ò԰˽øÖÆÊýÐÎʽÊä³öÕûÊý¡£¸ñʽ£º%o£¬%mo,%lo£¬%mlo¶¼¿É¡£
(3)x(»òX)¸ñʽ·û£¬ÒÔÊ®Áù½øÖÆÊýÐÎʽÊä³öÕûÊý¡£¸ñʽ£º%x£¬%mx,%lx£¬%mlx¶¼¿É¡£
(4)u¸ñʽ·û£¬ÓÃÀ´Êä³öunsignedÐÍÊý¾Ý£¬¼´ÎÞ·ûºÅÊý£¬ÒÔÊ®½øÖÆÊýÐÎʽÊä³ö¡£¸ñʽ£º%u£¬%mu,%lu¶¼¿É¡£
²Î¼û:li4-3.c/*ÎÞ·ûºÅÊý¾ÝµÄÊä³ö*/
(5)c¸ñʽ·û£¬ÓÃÀ´Êä³öÒ»¸ö×Ö·û¡£¸ñʽ£º%c£¬%mc¶¼¿É¡£
(6)s¸ñʽ·û£¬ÓÃÀ´Êä³öÒ»¸ö×Ö·û´®¡£¸ñʽ£º%s£¬%ms,%-ms£¬%m.ns£¬%-m.ns¶¼¿É¡£
(7)f¸ñʽ·û£¬ÓÃÀ´Êä³öʵÊý£¨°üÀ¨µ¥¡¢Ë«¾«¶È£©£¬ÒÔСÊýÐÎʽÊä³ö¡£¸ñʽ£º%f£¬
Ïà¹ØÎĵµ£º
2008-06-05 12:38------------------------------------------------------------------------------------------------
º¯ÊýÖ¸Õëͨ³£ÓÃÀ´ÊµÏֻص÷£¬Æä»ù±¾Ó÷¨ÈçÏ£º
1¡¢¶¨Ò庯ÊýÖ¸ÕëÀàÐÍ
// ¶¨ÒåÒ»¸öÔÐÍΪint Fun( int a );µÄº¯ÊýÖ¸Õë
typedef int (*PTRFUN) ( int aPara );
2¡¢º¯ÊýÖ¸Õë±äÁ¿µ ......
Ò»¸öÓÉC/C++±àÒëµÄ³ÌÐòÕ¼ÓõÄÄÚ´æ·ÖΪÒÔϼ¸¸ö²¿·Ö
1¡¢Õ»Çø£¨stack£©— ÓɱàÒëÆ÷×Ô¶¯·ÖÅäÊÍ·Å
£¬´æ·Åº¯ÊýµÄ²ÎÊýÖµ£¬¾Ö²¿±äÁ¿µÄÖµµÈ¡£Æä²Ù×÷·½Ê½ÀàËÆÓÚÊý¾Ý½á¹¹ÖеÄÕ»¡£
2¡¢¶ÑÇø£¨heap£© — Ò»°ãÓɳÌÐòÔ±·ÖÅäÊÍ·Å
£¬
Èô³ÌÐòÔ±²»ÊÍ·Å£¬³ÌÐò½áÊøʱ¿ÉÄÜÓÉOS»ØÊÕ ¡£×¢ÒâËüÓëÊý¾Ý½á¹¹ÖеĶÑÊÇÁ½»ØÊ£¬·ÖÅä·½ ......
12.1 λÔËËã·û£ÃÓïÑÔÌṩÁËÁùÖÖλÔËËã·û£º
& °´Î»Óë
| °´Î»»ò
^ &nb ......
#include <stdio.h>
#include <string.h>
#include <math.h>
#define BASE 10
int intlen(long n);
int main()
{
int i, j, num, sz;
i = j = num = sz = 0;
if (!scanf("%d", &num) || num <= 0) {
printf("invalid input\n");
retu ......
Ò»¡¢ÆÁÄ»²Ù×÷º¯Êý
1. clrscr()Çå³ý×Ö·û´°¿Úº¯Êý
2. window()×Ö·û´°¿Úº¯Êý
3. gotoxy()¹â±ê¶¨Î»º¯Êý
4. clreol() Çå³ý¹â±êÐÐβ×Ö·ûº¯Êý
5. insline() ²åÈë¿ÕÐк¯Êý
6. delline() ɾ³ýÒ»Ðк¯Êý
7. gettext() ¿½½øÎÄ×Öº¯Êý
8. puttext() ¿½³öÎÄ×Öº¯Êý
9. movetext() Òƶ¯ÎÄ×Öº¯Êý
¶þ¡¢×Ö·ûÊôÐÔº¯Êý
10. textmode( ......