HDU ACM STEP 1.2.8 ASCII

ASCII

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 5136 Accepted Submission(s): 2360

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

Input
The first line contains one integer T (1<=T<=1000).
The input will contain T positive integers separated by whitespaces (spaces, newlines, TABs).
The integers will be no less than 32.
 

Output
Output the corresponding message in just one line.
Warning: no extra characters are allowed.
 

Sample Input
13
72 101 108 108 111 44
32 119 111 114 108 100 33
 

Sample Output
Hello, world!
 

这道题出乎意料的简单,只要过了这一个用例就可以了。。。

#include <iostream>

using namespace std;

void main()
{
	int Total_ASCII_Num;

	cin >> Total_ASCII_Num;

	int a[1001] = {0};

	for (int i = 0;i < Total_ASCII_Num; i++)
	{
		cin >> a[i];
	}
	for (int i = 0;i < Total_ASCII_Num; i++)
	{
		cout << char(a[i]);
	}

}


猜你喜欢

转载自blog.csdn.net/qq_39459939/article/details/79063130