正在加载图片...
if include <stdio.h> int main (void) 31.1程序解析 int mynumber 38 int yournumber I Input your number: 48 Sorry your num ber is bigger than my number! printf("Input your number: scanf("%d", &yournumber); Input your number: 38 Ok! you are right if(yournumber = mynumber) printf("Ok! you are right! n"); 多层缩进的书写格式 else 使程序层次分明 if (yournumber mynumber printf("Sorry! your number is bigger than my number!n); else printf("Sorry! your number is smaller than my number!n") return o# int include main(void) <stdio.h> 3.1.1 程序解析 { int mynumber = 38; int yournumber; printf("Input your number: "); scanf("%d", &yournumber); if(yournumber == mynumber) printf("Ok! you are right!\n"); else if(yournumber > mynumber ) printf("Sorry! your number is bigger than my number!\n"); else printf("Sorry! your number is smaller than my number!\n"); return 0; } Input your number:48 Sorry! your number is bigger than my number! 多层缩进的书写格式 使程序层次分明 Input your number:38 Ok! you are right!
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有