GerexD

gyak 9 1-3

Dec 12th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a,b,c,d;
  8. cout<<"a=";cin>>a;
  9. cout<<"b=";cin>>b;
  10. cout<<"c=";cin>>c;
  11. if (a<d)
  12. d=a;
  13. if (b<d)
  14. d=b;
  15. if (c<d)
  16. d=c;
  17.  
  18. cout<<"A legkisebb:"<<d;
  19. return 0;
  20. }
  21. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  22. #include <iostream>
  23.  
  24. using namespace std;
  25.  
  26. int main()
  27. {
  28. int a,b;
  29. int x;
  30. cout<<"a=";cin>>a;
  31. cout<<"b=";cin>>b;
  32. x=(-b)/a;
  33. cout<<a<<"x+"<<b<<endl;
  34. cout<<"x="<<x;
  35.  
  36. return 0;
  37. }
  38. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  39. #include <iostream>
  40.  
  41. using namespace std;
  42.  
  43. int main()
  44. {
  45. int a,b,c,d,e,y;
  46. cin>>a;
  47. b=a/1000;
  48. c=a/100%10;
  49. d=a/10%10;
  50. e=a%10;
  51.  
  52. y=e*1000+d*100+c*10+b;
  53. if (a==y)
  54. cout<<"A szam palindrom";
  55. else
  56. cout<<"A szam nem palindrom";
  57.  
  58. return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment