1 条题解

  • -1
    @ 2023-12-17 17:04:35
    #include <bits/stdc++.h> // 万能头 
    using namespace std;
    
    int main() {
    	int n,ans=0; cin>>n;
    	for(int i=1; i<=n; i++){
    		// i=123     b=321
    		int t=i, b=0;
    		while(t){
    			b = b*10 + t%10;
    			t /= 10;
    		}
    		if(i==b) ans++; 
    	}
    	cout<<ans;
        return 0;
    }
    
    • 1

    信息

    ID
    33
    时间
    1000ms
    内存
    128MiB
    难度
    5
    标签
    递交数
    32
    已通过
    16
    上传者