QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#279031#5436. DRX vs. T1Jalppatel1428Compile Error//C++14307b2023-12-08 03:22:022023-12-08 03:22:02

Judging History

你现在查看的是最新测评结果

  • [2023-12-08 03:22:02]
  • 评测
  • [2023-12-08 03:22:02]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int solve(){
	string str;
	cin>>str;
	int cnt=0;
	for(int i=0;i<n;i++){
		cnt+=(str[i]=='T');
		cnt-=(str[i]=='D');	
	}
	if(cnt>0)cout<<"T1"<<endl;
	else cout<<"RDX"<<endl;
}

int main(){
	int tc;
	cin>>tc;
	while(tc--)solve();
	return 0;
}

Details

answer.code: In function ‘int solve()’:
answer.code:8:23: error: ‘n’ was not declared in this scope
    8 |         for(int i=0;i<n;i++){
      |                       ^
answer.code:14:1: warning: no return statement in function returning non-void [-Wreturn-type]
   14 | }
      | ^