方法一直接顯示雙引號(hào)內(nèi)的全部字符,如printf("This is an apple");輸出時(shí)便會(huì)是This is an apple
printf("任意字符1 %d 任意字符2 %s",整型變量1,字符型變量2);
方法二是在顯示任意字符的基礎(chǔ)上,再顯示相應(yīng)變量所代表的值或者字符,變量可以是其他類型,只要與前面的輸出類型相互對(duì)應(yīng)即可。如a=5;b=“on the table”;printf("There are %d apples %s",a,s);顯示的即There are 5 apples?on the table
2018-07-04
printf("任意文字或字符");
方法一直接顯示雙引號(hào)內(nèi)的全部字符,如printf("This is an apple");輸出時(shí)便會(huì)是This is an apple
printf("任意字符1 %d 任意字符2 %s",整型變量1,字符型變量2);
方法二是在顯示任意字符的基礎(chǔ)上,再顯示相應(yīng)變量所代表的值或者字符,變量可以是其他類型,只要與前面的輸出類型相互對(duì)應(yīng)即可。如a=5;b=“on the table”;printf("There are %d apples %s",a,s);顯示的即There are 5 apples?on the table
或者舉個(gè)更簡單的例子a=1;b=2;printf("a=%d,b=%d",a,b);顯示的結(jié)果就是a=1,b=2
2018-07-07
是你讓電腦運(yùn)算,不是自己直接運(yùn)算判斷,好吧