Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <ctime>
- using namespace std;
- int tablica[10][10];
- int main()
- {
- srand(time(NULL));
- for (int i = 0; i < 10; i++) for (int j = 0; j < 10; j++) tablica[i][j] = rand()%100+1;
- int x;
- cout << "wprowadz numer wiersza od 1 do 10: ";
- cin >>x;
- while(x<1 || x>10){
- cout << "wprowadziles zly numer wiersza. Wprowadz ponownie: ";
- cin >>x;
- }
- x--;
- int y;
- for (int i = 0; i < 10; i++) y+=tablica[x][i];
- for (int i = 0; i < 10; i++){
- for (int j = 0; j < 10; j++){
- cout << tablica[i][j] << " ";
- }
- cout << endl;
- }
- cout << "suma liczb w wierszu " << x+1 << " wynosi: " << y << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment