Advertisement
Guest User

laba1

a guest
Oct 24th, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.30 KB | None | 0 0
  1. 1)
  2.     int a = 13/5;
  3.     int b = 13%5;
  4.     int c = 13.0/5;
  5.     double d = 13/5;
  6.     double e = 13%5;
  7.     double f = 13.0/5;
  8.     double g = 13/5 + 2/5;
  9.     double h = 13.0/5 + 2.0/5;
  10.     int i = 13.0/5 + 2.0/5;
  11.     cout<<a<<endl;//деление целого числа 2
  12.     cout<<b<<endl;//остаток от числа 3
  13.     cout<<b<<endl;//деление числе с точкой 3
  14.     cout<<d<<endl;//деление дробного числа 2
  15.     cout<<e<<endl;//остаток дробного числа 3
  16.     cout<<f<<endl;//деление дробного числа с точкой 2.6
  17.     cout<<g<<endl;//деление дробного числа 2+0=2
  18.     cout<<h<<endl;//деление дробных чисел с точкой 3+0=3
  19.     cout<<i;//деление целых чисел с точкой 3+0=3
  20. }
  21. 2)
  22. //2
  23. int x;
  24. x=x*x;
  25. x=x*x;
  26. 3)
  27. x=x*x;
  28. x=x*x*x;
  29. 4)
  30. int x,a,b;
  31. b=x*x;
  32. a=b*b*b;
  33. x=a*x;
  34. 5)
  35. int x;
  36. x=x*x;
  37. x=x*x;
  38. x=x*x;
  39. 6)
  40. int x,a,b,c;
  41. a=x*x;
  42. b=a*a*a;
  43. c=b*b;
  44. x=c*x;
  45. 7)
  46. int x,a,b,c;
  47. a=x*x*x;
  48. b=a*a*a;
  49. c=b*b;
  50. x=c*a;
  51. 8)
  52. string x;
  53. cin>>x;
  54. cout<<x[x.size()-1];
  55. 9)
  56. int x;
  57. cin>>x;
  58. x=x/10;
  59. cout<<x;
  60. 10)
  61. string x;
  62. cin>>x;
  63. cout<<x[x.size()-2];
  64. 11)
  65. int x;
  66. cin>>x;
  67. cout<<x/100+x/10%10+x%10;
  68. 12)
  69. int h,m,x;
  70. cin>>h>>m;
  71. x=360/12*h+360/60*m/24;
  72. cout<<x;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement