Advertisement
Cieslin

PPTabliceStatyczne

Dec 1st, 2017
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <conio.h>
  3. #include <stdio.h>
  4. #include <iostream>
  5.  
  6. using namespace std;
  7.  
  8.  
  9. int main()
  10. {
  11.     int suma=0;
  12.     int cyfra[4];
  13.     printf("Podaj kolejno 4 cyfry: ");
  14.     for (int i = 0; i < 4; i++)
  15.     {
  16.         scanf("%d", &cyfra[i]);
  17.     }
  18.     for (int i = 0; i < 4; i++)
  19.     {
  20.         printf("%d\n", cyfra[i]);
  21.         suma = suma + cyfra[i];
  22.     }
  23.     printf("%d\n", suma);
  24.     _getch();
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement