Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include<stdio.h>
- int main() {
- int n1,n2,i,j,x,jsum=0,m[50][50];
- scanf("%d %d %d",&x,&n1,&n2);
- for(i=0;i<n1;i++)
- {
- for(j=0;j<n2;j++)
- {
- scanf("%d",&m[i][j]);
- }
- }
- for(i=0;i<n1;i++)
- {
- for(j=0;j<n2;j++)
- {
- jsum+=m[50][50];
- if(jsum>x)
- {
- m[i][j]=1;
- }
- else if(jsum<x)
- {
- m[i][j]=-1;
- }
- else if(jsum=x)
- {
- m[i][j]=0;
- }
- }
- }
- for(i=0;i<n1;i++)
- {
- for(j=0;j<n2;j++)
- {
- printf("%d",m[i][j]);
- }
- printf("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement