#include<bits/stdc++.h> using namespace std; bool is_include_three(int n){ string s=to_string(n); for(int i=0;i<s.size();i++){ if(s[i] == '3'){ return true; } } return false; } int main(){ int x; cin>>x; if(is_include_three(x) || x%3==0){ cout<<"guo"; } else{ cout<<x; } return 0; } 逻辑似乎没有问题,为什么只得30分?

1 条评论

  • @ 2025-7-27 13:41:59

    用字符串

    • 1