找回密码
 立即注册
搜索
热搜: 代码
查看: 11|回复: 3

第三题84.6代码

[复制链接]

7

主题

1

回帖

8024

积分

论坛元老

积分
8024
发表于 4 天前 | 显示全部楼层 |阅读模式
#include<bits/stdc++.h>
using namespace std;
int main(){   
long long a,b;   
cin>>a>>b;   
while(a>=10&&b>=10){        
int c=a%10,d=b%10;        
if(c+d>=10) {            
cout<<"Hard";            
return 0;        
}         
a/=10;        
b/=10;   
}   
cout<<"Easy";   
return 0;
}

6

主题

10

回帖

747

积分

管理员

积分
747
发表于 4 天前 | 显示全部楼层
#include<bits/stdc++.h>
using namespace std;
int main(){   
    long long a, b;   
    cin >> a >> b;   
    while(a >= 10 && b >= 10){
        int c = a % 10, d = b % 10;        
        if(c + d >= 10) {            
            cout << "Hard";            
            return 0;        
        }         
        a /= 10;        
        b /= 10;   
    }   
    cout << "Easy";   
    return 0;
}

0

主题

4

回帖

8011

积分

论坛元老

积分
8011
发表于 4 天前 | 显示全部楼层
#include<bits/stdc++.h>
using namespace std;
int main(){   
        long long a,b;   
        cin>>a>>b;   
        while(a>=10&&b>=10){        
                long long c=a%10,d=b%10;        
                if(c+d>=10) {            
                        cout<<"Hard";            
                        return 0;        
                }         
                a/=10;        
                b/=10;   
        }   
        long long c=a%10,d=b%10;        
                if(c+d>=10) {            
                        cout<<"Hard";            
                        return 0;        
                }         
                a/=10;        
                b/=10;
        cout<<"Easy";   
        return 0;
}

0

主题

4

回帖

8011

积分

论坛元老

积分
8011
发表于 4 天前 | 显示全部楼层
#include<bits/stdc++.h>
using namespace std;
int a;
int b[3];
int main(){   
        cin>>a;
        if(a>=42){
                a++;
        }
        b[3]=a%10;
        b[2]=a/10%10;
        b[1]=a/100%10;
        cout<<"AGC"<<b[1]<<b[2]<<b[3];
        return 0;
}
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|编程

GMT+8, 2025-10-29 18:54 , Processed in 0.060158 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表