#19196: c++ AC


089487 (089487)

學校 : 國立臺灣師範大學附屬高級中學
編號 : 82069
來源 : [220.130.10.185]
最後登入時間 :
2024-04-01 11:16:18
c561. Bert 愛搗蛋 | From: [111.71.59.64] | 發表日期 : 2019-09-14 10:23

#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
int n[t]={0};
string s;
for(int i=0;i<t;i++)
{
cin>>s;
for(int j=s.length()-1;j>=0;j--)
{
n[i]=n[i]*10+(s[j]-'0');
}
//cout<<n[i]<<endl;
}
sort(n,n+t);
cout<<n[t-1]<<endl;
}

AC (21ms, 752KB)

 
#19198: Re:c++ AC


ufve0704 (爬 我爬 我爬爬爬 有排行榜這種東西就是要爬 爬過我上面的那...)

學校 : 臺北市私立延平高級中學
編號 : 83268
來源 : [203.72.178.1]
最後登入時間 :
2023-10-30 13:02:50
c561. Bert 愛搗蛋 | From: [114.42.213.215] | 發表日期 : 2019-09-14 10:39

#include
#include
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
int n[t]={0};
string s;
for(int i=0;i<t;i++)
{
cin>>s;
for(int j=s.length()-1;j>=0;j--)
{
n[i]=n[i]*10+(s[j]-'0');
}
//cout<<n[i]<<endl;
}
sort(n,n+t);
cout<<n[t-1]<<endl;
}

AC (21ms, 752KB)

 

AC (17ms, 748KB) 



 
#19199: Re:c++ AC


089487 (089487)

學校 : 國立臺灣師範大學附屬高級中學
編號 : 82069
來源 : [220.130.10.185]
最後登入時間 :
2024-04-01 11:16:18
c561. Bert 愛搗蛋 | From: [111.71.59.64] | 發表日期 : 2019-09-14 11:36

#include
#include
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
int n[t]={0};
string s;
for(int i=0;i<t;i++)
{
cin>>s;
for(int j=s.length()-1;j>=0;j--)
{
n[i]=n[i]*10+(s[j]-'0');
}
//cout<<n[i]<<endl;
}
sort(n,n+t);
cout<<n[t-1]<<endl;
}

AC (21ms, 752KB)

AC (12ms, 104KB)

 

AC (17ms, 748KB) 






 
#19200: Re:c++ AC


089487 (089487)

學校 : 國立臺灣師範大學附屬高級中學
編號 : 82069
來源 : [220.130.10.185]
最後登入時間 :
2024-04-01 11:16:18
c561. Bert 愛搗蛋 | From: [111.71.59.64] | 發表日期 : 2019-09-14 11:37

#include
#include
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
int n[t]={0};
string s;
for(int i=0;i<t;i++)
{
cin>>s;
for(int j=s.length()-1;j>=0;j--)
{
n[i]=n[i]*10+(s[j]-'0');
}
//cout<<n[i]<<endl;
}
sort(n,n+t);
cout<<n[t-1]<<endl;
}

AC (21ms, 752KB)

AC (12ms, 104KB)

 

AC (17ms, 748KB) 



#include<stdio.h>
int main()
{
	int t;
	scanf("%d",&t);
	int max=-1;
	for(int i=0;i<t;i++)
	{
		int num=0;
		int a;
		scanf("%d",&a);
		while(a>0)
		{
			num=num*10+a%10;
			a/=10;
		}
		max=(num>max)?num:max;
	}
	printf("%d\n",max);
}

AC (12ms, 104KB)






 
#19206: Re:c++ AC


ufve0704 (爬 我爬 我爬爬爬 有排行榜這種東西就是要爬 爬過我上面的那...)

學校 : 臺北市私立延平高級中學
編號 : 83268
來源 : [203.72.178.1]
最後登入時間 :
2023-10-30 13:02:50
c561. Bert 愛搗蛋 | From: [114.42.213.215] | 發表日期 : 2019-09-14 20:03

#include
#include
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
int n[t]={0};
string s;
for(int i=0;i<t;i++)
{
cin>>s;
for(int j=s.length()-1;j>=0;j--)
{
n[i]=n[i]*10+(s[j]-'0');
}
//cout<<n[i]<<endl;
}
sort(n,n+t);
cout<<n[t-1]<<endl;
}

AC (21ms, 752KB)

AC (12ms, 104KB)

 

AC (17ms, 748KB) 



#include
int main()
{
	int t;
	scanf("%d",&t);
	int max=-1;
	for(int i=0;i<t;i++)
	{
		int num=0;
		int a;
		scanf("%d",&a);
		while(a>0)
		{
			num=num*10+a%10;
			a/=10;
		}
		max=(num>max)?num:max;
	}
	printf("%d\n",max);
}

AC (12ms, 104KB)







3ms,88kb

 
ZeroJudge Forum