fork(3) download
  1. #include <stdio.h>
  2. #include <locale.h>
  3.  
  4. int main(void)
  5. {
  6. setlocale(LC_ALL, "Russian");
  7.  
  8. float t = 0, G = 9.8, v;
  9. int quantity = 5;
  10.  
  11. printf("Введите количество секунд: %d", quantity);
  12.  
  13. printf("-------------------------\n");
  14. printf("Время, c \t Скорость, м/с\n");
  15. printf("-------------------------\n");
  16. for(int i = 0; i <= quantity*2; i++)
  17. {
  18. v = t * G;
  19. printf("%2.1f \t\t %2.2f\n", t, v);
  20. t += 0.5;
  21. }
  22. }
Success #stdin #stdout 0s 11072KB
stdin
Standard input is empty
stdout
Введите количество секунд: 5-------------------------
Время, c 	 Скорость, м/с
-------------------------
0.0 		 0.00
0.5 		 4.90
1.0 		 9.80
1.5 		 14.70
2.0 		 19.60
2.5 		 24.50
3.0 		 29.40
3.5 		 34.30
4.0 		 39.20
4.5 		 44.10
5.0 		 49.00