2812 - 输入字母ASC码
输入一串字符,要求输出该字符的asc码
Input
一行,一串字符n,n<=250个字
Output
一个字符一行
Examples
Input
ABCD
Output
65 66 67 68
Hint
ord 把字符变成asc码函数
Solution C++
#include <stdio.h> #include <string.h> #include <iostream> using namespace std; int main(){ char n[255]; gets(n); int l=strlen(n); for(int i=0;i<l;i++){ printf("%d\n",n[i]); } }
Hint
ord 把字符变成asc码函数