top1编程
← 返回题目
题解

【入门】数字游戏

1 条题解

  • 0
    @ 2026-7-29 0:18:19
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int n,sum=0;
    	cin>>n;
    	while(n!=0){
    		if(n%10==1){
    			sum++;
    		}
    		n/=10;
    	}
    	cout<<sum;
        return 0;
    }
    //T
    //NOIP
    //J
    //练 
    //P
    //图像相似度
    //多项式求值
    
    • 1