fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main(){
  4. int n,m,x;cin>>n>>m;
  5. int a[n][m];
  6. for (int i=0;i<n;i++){
  7. for(int j=0;j<m;j++){
  8. cin >> a[i][j];
  9. }
  10. }
  11. cin >> x;
  12. int ans=0;
  13. for (int i=0;i<n;i++){
  14. for(int j=0;j<m;j++){
  15. ans++;
  16. if (a[i][j]==x)
  17. {
  18. cout << "will not take number";
  19. break;
  20. }
  21. else if (n*m==ans)
  22. {
  23. cout << "will take number";
  24. break;
  25. }
  26. }}
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34. }
Success #stdin #stdout 0s 5352KB
stdin
Standard input is empty
stdout
Standard output is empty