已已删除的账号#include <iostream> #include <cmath> using namespace std; int main (){ int n, m, s=0, y; cin>>n>>m; int x=n%int(pow(10,m)); while(x!=0){ y=x%10; s+=y; x/=10; } cout<<s; } /stdin 123 206:28