fork download
  1.  
  2. #include <iostream>
  3. #include <iomanip>
  4. #include<cmath>
  5. using namespace std;
  6. /*
  7. //Zadanie 1
  8. int main() {
  9.   float A, B;
  10.   cin >> A >> B;
  11.  
  12.   float iloraz = A / B;
  13.  
  14.   cout << fixed << setprecision(4) << iloraz;
  15.  
  16.   return 0;
  17. }
  18. //Zadanie 2
  19. int main() {
  20. int g, n, P, K;
  21. cin>>g;
  22. cin>>n;
  23. P=(n-2*g)/2;
  24. K=g-P;
  25. cout<<"Psy:"<<P<<"Kaczki:"<<K;
  26. return 0;
  27. }
  28.  
  29. //Zadanie 3
  30. int main(){
  31. int l, u, m;
  32. cin>>l;
  33. cin>>u;
  34. cin>>m;
  35. int j=(l-u)/m;
  36. cout<<j;
  37. }
  38.  
  39. //Zadanie 4
  40. int main(){
  41.   int md, m, n, mp;
  42.   cin >> n >> mp;
  43.   m = (mp - 2 * n) / 3;
  44.   md = n - m;
  45.   cout << "monety dwuzlotowe: " << md << endl;
  46.   cout << "monety pieciozlotowe: " << m << endl;
  47.   return 0;
  48. }
  49.  
  50. //Zadanie 5
  51. int main(){
  52. int n, m, k, t;
  53. cin>>n>>m>>k>>t;
  54. cout<<(n*m+k)-t;
  55. return 0;
  56. }
  57.  
  58. //Zadanie 6
  59. int main(){
  60. int n, p, l, m;
  61. cin>>n>>p>>m>>l;
  62. cout<<p+l-(n-m);
  63. return 0;
  64. }
  65.  
  66. //Zadanie 7
  67. int main(){
  68. int u, n, s;
  69. cin>>u>>n>>s;
  70. float c=s/(u/2.0+n);
  71. cout<<fixed<<setprecision(2)<<c;
  72. return 0;
  73. }
  74.  
  75. //Zadanie 8
  76. int main(){
  77. int A, B, C;
  78. cin>>A>>B>>C;
  79. float x=-B/(2.0*A);
  80. int delta=B*B-4*A*C;
  81. float y=-delta/4*A;
  82. cout<<fixed<<setprecision(2)<<x<<y;
  83. return 0;
  84. }
  85.  
  86. //Zadanie 9
  87. int main(){
  88. int w;
  89. cin>>w;
  90. int k=3*w/2;
  91. int s=w/2+2;
  92. cout<<"krawedzie:"<<k<<endl;
  93. cout<<"sciany:"<<s;
  94. }
  95.  
  96. //Zadanie 10
  97. int main(){
  98. int A, B, C, D, E, F;
  99. cin>>A>>B>>C>>D>>E>>F;
  100. float w=A*E-B*D;
  101. float WX=C*E-B*F;
  102. float WY=A*F-C*D;
  103. cout<<fixed<<setprecision(3);
  104. cout<<"x="<<WX/w<<endl;
  105. cout<<"y="<<WY/w<<endl;
  106. return 0;
  107. }
  108.  
  109. //Zadanie 11
  110. int main(){
  111. float a, b;
  112. cin>>a>>b;
  113. float c=sqrt(a*a+b*b);
  114. cout<<fixed<<setprecision(4)<<c;
  115. return 0;
  116. }
  117.  
  118. //Zadanie 12
  119. int main(){
  120. float w, p;
  121. cin>>w;
  122. p=w*(w-3)/2;
  123. cout<<p;
  124. return 0;
  125. }
  126.  
  127. //Zadanie 13
  128. int main(){
  129. int a, b, c, d;
  130. cin>>a>>b>>c>>d;
  131. cout<<"iloczyn="<<a*b*c*d;
  132. }
  133.  
  134. //Zadanie 14
  135. int main(){
  136. float a, h;
  137. cin>>a>>h;
  138. float p=a*h/2;
  139. cout<<"Pole trojkata o wymiarach "<<a<<" i "<<h<<"wynosi "<<p;
  140. }
  141.  
  142. //Zadanie 15
  143. int main(){
  144. float a, b;
  145. cin>>a>>b;
  146. float srednia=(a+b)/2;
  147. float geometryczna=sqrt(a*b);
  148. float harmoniczna=2/(1/a+1/b);
  149. cout<<fixed<<setprecision(2);
  150. cout<<srednia<<" "<<geometryczna<<" "<<harmoniczna;
  151. return 0;
  152. }
  153.  
  154. //Zadanie 16
  155. int main(){
  156. int a, b, c;
  157. cin>>a>>b>>c;
  158. int obw=a+b+c;
  159. int p=obw/2;
  160. int P=sqrt(p*(p-a)*(p-b)*(p-c));
  161. cout<<"Pole trojkata o bokach "<<a<<" "<<b<<" "<<c<<" wynosi "<<P<<" Jego obwod jest rowny "<<obw;
  162. return 0;
  163. }
  164.  
  165. //Zadanie 17
  166. int main(){
  167. float a, b, c;
  168. cin>>a>>b>>c;
  169. float v=a*b*c;
  170. cout<<fixed<<setprecision(4)<<"Objetosc prostopadloscianu "<<v;
  171. return 0;
  172. }
  173.  
  174. //Zadanie 18
  175. int main(){
  176. int c, n;
  177. cin>>c>>n;
  178. float p=n*1.0/(c+n);
  179. cout<<fixed<<setprecision(3)<<p;
  180. return 0;
  181. }*/
Compilation error #stdin compilation error #stdout 0.01s 5284KB
stdin
4 8
compilation info
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty