Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.  
  8. int a, b;
  9. int kl, ks;
  10. int ps;
  11.  
  12. kl = 0;
  13. ks = 0;
  14.  
  15. cout << "Iveskite skaiciu a: ";
  16. cin >> a;
  17. cout << "Iveskite skaiciu b: ";
  18. cin >> b;
  19.  
  20. b++;
  21.  
  22. cout << "Skaiciai kurie dalijasi is penkiu ir yra patrigubinti: " << endl;
  23.  
  24. while (a<b)
  25. {
  26. if (a%7==3)
  27. {
  28.  
  29. kl++;
  30.  
  31. }
  32.  
  33. ps = a % 10;
  34.  
  35. if (ps==7)
  36. {
  37.  
  38. ks++;
  39.  
  40. }
  41.  
  42. if (a%5==0)
  43. {
  44.  
  45. cout << a*3 << endl;
  46.  
  47.  
  48. }
  49.  
  50. a++;
  51.  
  52. }
  53.  
  54.  
  55. cout << "Kiek yra skaiciu kuriuos padalinus is 7, liekana gaunasi 3?: " << kl << endl;
  56. cout << "Kiek yra skaiciu besibaigianciu skaitmeniu 7?: " << ks << endl;
  57.  
  58. _getch();
  59. return 0;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement