SHARE
TWEET

kakoe-to zadanie

a guest Oct 18th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. int a, b, c, d, s;
  5. for(int n = 1000; n<10000;) {
  6.     a=n/1000;
  7.     b=n/100%10;
  8.     c=n/10%10;
  9.     d=n%10;
  10.     s=a+b+c+d;
  11.     if(s==15){
  12.         cout << n << endl;
  13.         n++;
  14.         }
  15.         else {
  16.         n++;
  17.         }
  18.     }
  19. return 0;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top