题目:用C++编程键盘输入10个整数,输出各位数字之和为7的所有整数 问题:请问如何在循环中处理10

题目:用C++编程键盘输入10个整数,输出各位数字之和为7的所有整数 问题:请问如何在循环中处理10个数并输出?

#include <bits/stdc++.h>
using namespace std;
int main(){
    int i;
    int a;
    for(i=1;i<=10;i++){
        cin>>a;
        int he=0;
        int b=a;
        while(b>0){
            he=he+b%10;
            b=b/10;
        }
        if(he==7){
            cout<<a<<endl;
        }
    } 

    return 0;
}
 

上面是代码,看不懂私我。

望采纳😁😁😁