Advertisement
Stefan08

varianta82_II_5

Nov 14th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int a[11][11];
  4. int main()
  5. {
  6. int i,j,n,m,k,p=1,nr=0;
  7. cin>>k>>n>>m;
  8. for(i=1;i<=n;i++)
  9. {
  10. for(j=1;j<=m;j++)
  11. {
  12. cin>>a[i][j];
  13. if(a[i][j]==k)
  14. {
  15. a[0][j]++;
  16. }
  17. }
  18. }
  19. for(j=1;j<=m;j++)
  20. {
  21. if(a[0][j]!=0)
  22. {
  23. p=p*j;
  24. nr++;
  25. }
  26. }
  27. if(nr!=0)
  28. {
  29. cout<<p;
  30. }
  31. else
  32. {
  33. cout<<"NU EXISTA";
  34.  
  35. }
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement