I'm on Linux using VSCode with the C++ extension. I added gdb and g++!
#include <iostream>
#include <iomanip>
#include <list>
using namespace std;
int main(){
int number, sum=0;
cout<<"Number: "<<endl;
cin>>number;
while(number>0){
sum+=(number%10);
number/=10;
}
cout<<"Answer: "<<sum;
return 0;
}
Aucun commentaire:
Enregistrer un commentaire