Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <fstream>
- using namespace std;
- int main (){
- ifstream fin("input.txt");
- ofstream fout("output.txt");
- int n, arif, stop=0, sum=0;
- fin>>n;
- int mas[n][n];
- for(int k=0; k<n; k++)
- {
- for(int c=0; c<n; c++)
- {
- fin>>mas[k][c];
- }
- }
- arif=(1+n)*n/2;
- for(int k=0; k<n; k++)
- {
- for(int c=0; c<n; c++)
- {
- sum+=mas[c][k];
- }
- if(sum==arif)
- stop++;
- sum=0;
- }
- fout<<stop;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement