Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. int nrcif (int a)
  7. {
  8.  int nr=0;
  9.  while(a!=0)
  10.     {
  11.      a=a/10;
  12.      nr++;
  13.     }
  14.  return nr;
  15. }
  16.  
  17. int main()
  18. {
  19.     int a[100][100],n,cifp=0;
  20.     ifstream fin("mat.in");
  21.     fin>>n;
  22.     for(int i=1;i<=n;i++)
  23.         for(int j=1;j<=n;j++)
  24.             fin>>a[i][j];
  25.     for(int i=1;i<=n;i++)
  26.         for(int j=1;j<=n;j++)
  27.             if(i>j && nrcif(a[i][j])%2==0) cifp++;
  28.     cout<<cifp<<" numere";
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement