社区讨论

WA求调

P11784「FAOI-R4」问题跳转参与者 2已保存回复 1

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
1 条
当前快照
1 份
快照标识符
@mlhdhac5
此快照首次捕获于
2026/02/11 09:50
上周
此快照最后确认于
2026/02/11 10:55
上周
查看原帖
有没有dalao知道这代码有啥问题
CPP
#include<iostream>
#include<string>
using namespace std;
bool fulnum(string s){
    int t;
    for(t=0;t<s.size();t++){
        if(!(s[t]>=48&&s[t]<=57)){
            return false;
            break;
        }
    }
    if(t==s.size()){
        return true;
    }
}
int main(){
    int n;
    cin>>n;
    for(int m=0;m<n;m++){
        string a;
        getline(cin,a);
        if(fulnum(a)){
            cout<<"https://www.luogu.com.cn/problem/P"<<a<<"\n";
        }else{
            cout<<"https://www.luogu.com.cn/problem/"<<a<<"\n";
        }
    }
    return 0;
}
样例运行后变成这样了:
https://www.luogu.com.cn/problem/P
//这行是怎么出现的
https://www.luogu.com.cn/problem/P1001
https://www.luogu.com.cn/problem/P1234
https://www.luogu.com.cn/problem/B2027
https://www.luogu.com.cn/problem/U76533
https://www.luogu.com.cn/problem/T512682
https://www.luogu.com.cn/problem/CF10A
https://www.luogu.com.cn/problem/AT_abc114_d
https://www.luogu.com.cn/problem/SP11470
别点进去啊!

回复

1 条回复,欢迎继续交流。

正在加载回复...