Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int MAXN = 13;
- const int MAXM = 17;
- int n,m;
- int r[MAXN][MAXM];
- int sum[MAXN] = {0};
- int proz[MAXM] = {1};
- void calculate(){
- for(int i = 0; i < n; i++){
- for(int j = 0; j < m; j++){
- sum[i]+=r[i][j];
- }
- }
- for(int i = 0; i < n; i++){
- for(int j = 0; j < m; j++){
- proz[i] *= r[i][j];
- }
- }
- }
- int main(){
- scanf("%d%d", &n, &m);
- for(int i = 0; i < n; i++){
- for(int j = 0; j < m; j++){
- scanf("%d", &r[i][j]);
- }
- }
- for(int i = 0; i < n; i++){
- printf("%d ", sum[i]);
- for(int j = 0; j < n; j++){
- printf("%d ", r[i][j]);
- }
- printf("%d \n", proz[i]);
- }
- sort(sum, sum + n);
- sort(proz, proz + n);
- reverse(proz, proz + n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement