fork download
  1. #include <iostream>
  2. using namespace std;
  3. int x, somma=0;
  4. int main() {
  5. cin>>x;
  6. while (x!=100) {
  7.  
  8. if ((x%3==0)&&(x%2==0)) {somma=somma+x;}
  9. cin>>x;
  10. }
  11. cout<<somma;
  12. return 0;
  13. }
Success #stdin #stdout 0.01s 5288KB
stdin
2 4 6 43 32 4 27 36 48 100
stdout
90