TJU1001---天大OJ题

This is the first problem for test.

Since all we know the ASCII code, your job is simple: Input numbers and output corresponding messages.

 

Input

The input will contain a list of positive integers separated by whitespaces(spaces, newlines, TABs).
Please process to the end of file (EOF).
The integers will be no less than 32.

 

Output

Output the corresponding message.
Note there is NOT a newline character in the end of output.

 

Sample Input

72 101 108 108 111 44
32 119 111 114 108 100 33

Sample Output

Hello, world!
//空格是32 数字的ascll码在48到57之间
void TJU1001() {
	char buffer[100];
	int i = 0;             //指针
	int a;
	cin.getline(buffer, 100);   //接收一行数据
	while (buffer[i] != '\0') {
		a = 0;
		while (buffer[i] != 32 && buffer[i] != 0) {
			a *= 10;
			a += (int)buffer[i++] - 48;
		}
		cout << (char)a;
		while (buffer[i] == 32)
			i++;
		if (buffer[i] == 0) {
			//到了末尾就要从零开始
			cin.getline(buffer, 100);
			i = 0;
		}
	}
}

 

©️2020 CSDN 皮肤主题: 游动-白 设计师: 上身试试 返回首页
实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值