找回密码
 中文实名注册
搜索
查看: 199|回复: 9

请高人帮我看看

[复制链接]

21

主题

111

回帖

5230

积分

论坛元老

积分
5230
发表于 2025-8-7 17:28:13 | 显示全部楼层 |阅读模式
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;
    double f;
    cin >> n;
    f = (n - 2) * 180 / 3;
    cout << fixed << setprecision(1) << f << endl;
return 0;
}

回复

使用道具 举报

21

主题

111

回帖

5230

积分

论坛元老

积分
5230
 楼主| 发表于 2025-8-7 18:43:16 | 显示全部楼层
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n / 100000 % 10 = n / 10){
    }else if (n / 10000 % 10 = n / 10 % 10) {        
}else if (n / 1000 % 10 = n / 100 % 10) {
cout << "Y" << endl;
}else {
cout << "N" << endl;
}
return 0;
}

点评

out  发表于 2025-8-9 14:55
回复

使用道具 举报

21

主题

111

回帖

5230

积分

论坛元老

积分
5230
 楼主| 发表于 2025-8-8 18:14:31 | 显示全部楼层
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
    cin >> n;
    int tax1 = 0;
    double tax2 = 0.0;
    tax1 = n / 100 + n % 100;
    tax2 = (n / 100) / (n % 10);
    cout << fixed << setprecision(1) << tax1 << endl << tax2 << endl;
return 0;
}
回复

使用道具 举报

21

主题

111

回帖

5230

积分

论坛元老

积分
5230
 楼主| 发表于 2025-8-9 14:25:54 | 显示全部楼层
#include<iostream>
using namespace std;
int main (){
    int x;
    cin >> x;
if(x/ 100 % 10 < x/ 10%10&& x / 10%  10 <x % 10)
{
    cout << "YES" << endl;
}
   
else{
    cout<< "NO" << endl;
}
return 0;
}
回复

使用道具 举报

21

主题

111

回帖

5230

积分

论坛元老

积分
5230
 楼主| 发表于 2025-8-9 15:38:57 | 显示全部楼层
#include <iostream>
using namespace std;
int main() {
    int x, y;
    cin >> x >> y;
if (x == y)  
{
    cout<< 100 << endl;
}
else if(x / 10 % 10 == y % 10 && x % 10 == y / 10 % 10)
{
    cout<< 20 << endl;
    }
else if (x  % 10 == y % 10 || x/10 % 10 == y  %10||x  % 10 == y / 10 %10 || x / 10 % 10 == y /10 % 10)
{
    cout<< 2 << endl;
    }
else {
    cout<< 0 << endl;
    }
    return 0;
}
回复

使用道具 举报

21

主题

111

回帖

5230

积分

论坛元老

积分
5230
 楼主| 发表于 2025-8-9 16:17:43 | 显示全部楼层
#include <iostream>
using namespace std;

int main() {
    char x;
    cin >> x;

    cout << "  " << x <<endl;
    cout << " " << x << x << x <<endl;
    cout << x << x << x << x << x <<endl;
    return 0;
}
回复

使用道具 举报

21

主题

111

回帖

5230

积分

论坛元老

积分
5230
 楼主| 发表于 2025-8-9 16:21:38 | 显示全部楼层
#include <iostream>
using namespace std;
int main() {
    int first;
    int second;
char op;
    cin >> first >> op >> second;
    if (op == '+'){
        cout << first + second << endl;
    }else if (op == '-'){
        cout << first - second << endl;
    }else if (op == '*'){
            cout << first * second << endl;
    }else if (op == '/'){
            cout << first / second << endl;
    }else if (op == '%'){
        cout << first % second << endl;
    }
    return 0;
}
回复

使用道具 举报

21

主题

111

回帖

5230

积分

论坛元老

积分
5230
 楼主| 发表于 2025-8-9 16:25:23 | 显示全部楼层
#include <iostream>
using namespace std;
int main(){
    char x;
    double m ,n;
    cin >> x >>  m >> n;
if (x == 'r'){
    cout << m * n << endl;
}else{
    cout << m * n * 0.5 << endl;
}
return 0;
}
回复

使用道具 举报

21

主题

111

回帖

5230

积分

论坛元老

积分
5230
 楼主| 发表于 2025-8-9 17:02:04 | 显示全部楼层
#include <iostream>
using namespace std;
int main() {
    int x ;
    char y ;
    cin >>x>>y;
    cout << char(x)<<endl;
    cout << int(y)<<endl;
    return 0;
}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 中文实名注册

本版积分规则

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