rygyfygy

TABLICA DWUWYMIAROWA KWADRATY LICZBY

Nov 9th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. //TABLICA DWUWYMIAROWA KWADRATY LICZBY
  2. #include <iostream>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. int main(){
  8.  
  9. const int n=10;
  10.  
  11. int i,j,suma,macierz[n][n];
  12.  
  13. for(i=0;i<n;i++)//wpisywanie do tablicy
  14. {
  15. for(j=0;j<n;j++){
  16. if (j==0) macierz[i][j]=i;
  17. if (j==1) macierz[i][j]=i*i;
  18. if (j>1) macierz[i][j]=0;
  19.  
  20. }
  21. }
  22.  
  23. for(i=0;i<n;i++)
  24. {for(j=0;j<n;j++)
  25. {
  26. cout<<setw(2)<<macierz[i][j]<<" ";
  27.  
  28. }cout<<endl;
  29. }
  30.  
  31. suma=0;
  32. cout<<endl;
  33. for(i=0;i<n;i++)
  34. {
  35. }
  36.  
  37.  
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment