游客 Signup | Login
中文 | En

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,不将,付给任何变量。

Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题