GerexD

GYAK10_9,10,11

Dec 18th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. GYAK10_9
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int a,b,c,d=0;
  9. cin>>a;
  10. cin>>b;
  11. cin>>c;
  12.  
  13.  
  14.  
  15. if (a+b>c && b+c>a && a+c>b)
  16. {
  17. cout<<"Kepezhetnek haromszoget";
  18. d=1;
  19. }
  20. else
  21. cout<<"Nem kepezhetnek haromszoget.";
  22.  
  23.  
  24.  
  25. if (d==1 && (a==b || b==c || a==c))
  26. cout<<"Egyenlo szaru a haromszog.";
  27.  
  28.  
  29. return 0;
  30. }
  31. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  32. GYAK10_10
  33.  
  34. #include <iostream>
  35.  
  36. using namespace std;
  37.  
  38. int main()
  39. {
  40. int a,b,c,d;
  41. cin>>a;
  42. b=a/100;
  43. c=a/10%10;
  44. d=a%10;
  45. if (b%2==0)
  46. b=b/2;
  47. if (c%2==0)
  48. c=c/2;
  49. if (d%2==0)
  50. d=d/2;
  51. cout<<"Az uj szam:"<<b*100+c*10+d;
  52.  
  53. return 0;
  54. }
  55. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  56. GYAK10_11
  57.  
  58. #include <iostream>
  59.  
  60. using namespace std;
  61.  
  62. int main()
  63. {
  64.  
  65. int a,b,c;
  66.  
  67. cin>>a;
  68. b=a/10;
  69. c=a%10;
  70.  
  71. if (b==c)
  72. cout<<"Az uj szam:"<<b*1111;
  73. else
  74. {
  75. if (b<c)
  76. {
  77. b=9;
  78. cout<<"Az uj szam:"<<b*10+c;
  79. }
  80. else
  81. {
  82. c=9;
  83. cout<<"Az uj szam:"<<b*10+c;
  84. }
  85. }
  86.  
  87.  
  88.  
  89. return 0;
  90. }
  91. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Advertisement
Add Comment
Please, Sign In to add comment