求助!!!
  • 板块学术版
  • 楼主1272707075zbx
  • 当前回复19
  • 已保存回复19
  • 发布时间2020/6/10 18:13
  • 上次更新2023/11/7 00:53:50
查看原帖
求助!!!
117403
1272707075zbx楼主2020/6/10 18:13
#include <bits/stdc++.h>
using namespace std;
int main(){
	freopen("article.txt","r",stdin);
	freopen("times.txt","w",stdout);
	int i=0,t[3000]={0},j=0;
	string w[3000];
	while(1){
		cin>>w[i];
		while(1){
			if(w[i]==w[j])
				t[j]++;
			if(i==j)
				break;
			j++;
		}
		j=0;
		i++;
		if(w[i]=="#")
			break;
	}
	
	i=0;
	while(1){
		cout<<w[i]<<":"<<t[i];
		if(w[i]=="#")
			break;
		i++;
	}
	return 0;
}

article.txt如下: Grandma Moses is among the most famous twentieth-century painters of the United States, yet she did not start painting until she was in her late seventies. As she once said of herself:"I would never sit back in a rocking chair, waiting for someone to help me." No one could have had a more productive old age. #

。。。 wrong 就是显示“1.0.exe已停止工作” 问一下大佬是怎么肥死??

2020/6/10 18:13
加载中...