scanf("%d%d%d",&x,&y,&z); scanf("%d,%d,%d",&x,&y,&z); 哪个对_百 ...答:都对 scanf("%d,%d,%d",&x,&y,&z);中%d,%d,%d之间有逗号,在输入数据时也要加逗号,如果去掉逗号,输入时就不用逗号,而用空格,tab键或回车键将各个数据隔开
...个整数表示的生日yyyymmdd,找出其中的年月日,并按以下格式输出...答:include<stdio.h> include<string.h> void main(){ long i = 0, y, m, d;scanf("%ld", &i);d = i%100;m = (i/100)%100;y = i/10000;printf("Y = %ld, M = %ld, D = %ld\n", y, m, d);} 运行结果:
scanf("%s",a);和scanf("%s",&b);有什么区别?能举个例子说明它们是不同...答:scanf("%s",&b);是正确的输入格式;scanf("%s",a);是错误的输入格式。例:include <stdio.h> int main(void){ int a,b,c;printf("Give me the value of a,b,c seperated with whitespaces:\n");scanf("%d%d%d",&a,&b,&c);printf("a=%d,b=%d,c=%d\n",a,b,c);return 0...