ABOUTYOU
scanf("%d",&num);printf("%d",num);因为scanf and printf是格式化输出,所以分两个部分,第一部分用分号扩起,%加格式,%d代表整数十进制,后面是相关数据,但scanf 将取得数据 放到num地址 所以加取地址符号&而printf使用是 直接跟想输出的数的变量名字num#include <stdio.h>void main( void ){int i, result;float fp;char c, s[81];wchar_t wc, ws[81];printf( "\n\nEnter an int, a float, two chars and two strings\n");result = scanf( "%d %f %c %C %s %S", &i, &fp, &c, &wc, s, ws );printf( "\nThe number of fields input is %d\n", result );printf( "The contents are: %d %f %c %C %s %S\n", i, fp, c, wc, s, ws);wprintf( L"\n\nEnter an int, a float, two chars and two strings\n");result = wscanf( L"%d %f %hc %lc %S %ls", &i, &fp, &c, &wc, s, ws );wprintf( L"\nThe number of fields input is %d\n", result );wprintf( L"The contents are: %d %f %C %c %hs %s\n", i, fp, c, wc, s, ws);}输出Enter an int, a float, two chars and two strings7198.6hzByte charactersThe number of fields input is 6The contents are: 71 98.599998 h z Byte charactersEnter an int, a float, two chars and two strings3692.3ynWide charactersThe number of fields input is 6The contents are: 456 92.300003 y n Wide characters