csansoon

P2.15 P32046 Control C202F

Sep 26th, 2018
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int n,x;
  6.     int total=0;
  7.     cin >> n;
  8.     cout << "nombres que acaben igual que " << n << ":" << endl;
  9.    
  10.     while (cin >> x) {
  11.         if ( (n%1000)==(x%1000) ) {
  12.             cout << x << endl;
  13.             total++;
  14.            
  15.         }
  16.     }
  17.     cout << "total: " << total << endl;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment