2974 - 【设计型】第4章:键盘输入和屏幕输出 简单的输出4
输入1,2,34
输出1,2,34
Input
Output
Examples
Input
1,2,34
Output
1,2,34
Hint
若是将,读入,输出的值很明显不是想要的值。所以在scanf中要加入%*c,不将,付给任何变量。
Solution C
#include<stdio.h> main() { char a,b; int c; scanf("%c%*c%c%*c%d",&a,&b,&c); printf("%c,%c,%d",a,b,c); }
Solution C++
#include<stdio.h> main() { char a,b; int c; scanf("%c%*c%c%*c%d",&a,&b,&c); printf("%c,%c,%d",a,b,c); }
Hint
若是将,读入,输出的值很明显不是想要的值。所以在scanf中要加入%*c,不将,付给任何变量。