- 比大小
坑死我这个不会字符串的人了
- 2024-12-24 14:14:07 @
#include <bits/stdc++.h>
using namespace std;
int main()
{
long long a,b,sa=0,sb=0;
cin>>a;
if(a<0) a*=-1;
while(a>9)
{
a/=10;
sa++;
}
cin>>b;
if(b<0) b*=-1;
while(b>9)
{
b/=10;
sb++;
}
if(sa>sb) cout<<"first";
else if(sa<sb) cout<<"second";
else if(sa==sb)
{
if(a>b) cout<<"first";
else if(a<b) cout<<"second";
else cout<<"same";
}
return 0;
}
2 comments
-
YYDSLINDAN LV 4 @ 2025-1-11 7:53:20
??????????
-
2024-12-24 17:29:20@
你把 都变成正数了还比较什么呢?
对于 的数据,。保证给定的数符合正常数的书写规范。
- 子任务 1(30 分):。
- 子任务 2(30 分):。
- 子任务 3(40 分):没有特殊限制。
- 1
Information
- ID
- 1591
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 7
- Tags
- (None)
- # Submissions
- 48
- Accepted
- 10
- Uploaded By