#include<cstdio>
#include<cstring>
#include<cstdlib>
struct Conquest {
char *name;
int number;
};
Conquest con[3000];
int main() {
int number;
char str[200];
int mark = 0;
scanf("%d\n", &number);
char temp[3000][100] ;
for(int i = 0; i < number; i++) {
char *temp = (char *)malloc(75);
memset(temp,'\0',sizeof(temp));
gets(str);
int start = 0;
// str[strlen(str)] = ' ';
// for(;1 ; start++) {
// if(str[start] < 'A' || (str[start] >'Z' && str[start] < 'a') || str[start] > 'z')
// continue;
// else
// break;
// }
//
int out = 0;
for(int j = 0; ; j++) {
if((str[j] >= 'A' && str[j] <= 'Z') || (str[j] >= 'a' && str[j] <= 'z')) {
temp[start] = str[j];
start++;
out = 1;
UVA - 10420 List of Conquests 结构体解法
最新推荐文章于 2019-02-16 23:05:35 发布
这是一个使用C++解决UVA 10420问题的程序,通过结构体存储征服者的名字和对应的征服次数。程序读取输入,将名字按字典序排序并统计重复项,最后输出每个征服者的名称及其征服次数。
摘要由CSDN通过智能技术生成