Advertisement
UberKill11

+Vectras :))

Mar 23rd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. int a[101][101],x[200];
  5.  
  6. int lant(int n)
  7. { int i,ok;
  8. ok=1;
  9. for(i=1;i<n;i++)
  10. if(a[x[i]][x[i+1]]==0 && a[x[i+1]][x[i]]==0)
  11. ok=0;
  12. return ok;
  13. }
  14. int drum(int n)
  15. {int i,ok=1;
  16. for(i=1;i<n;i++)
  17. if(a[x[i]][x[i+1]]==0)
  18. ok=0;
  19. return ok;
  20. }
  21. int elementar(int n)
  22. {int i,j,ok=1;
  23. for(i=1;i<n;i++)
  24. for(j=i+1;j<=n;j++)
  25. if(x[i]==x[j])
  26. ok=0;
  27. return ok;
  28. }
  29. int main()
  30. {int n,i,k,m,v,y,j;
  31. ifstream f("lant.in");
  32. f>>n>>m;
  33. for(i=1;i<=m;i++)
  34. {f>>v>>y;
  35. a[v][y]=1;}
  36. f.close();
  37. cin>>k;
  38. for(i=1;i<=k;i++)
  39. cin>>x[i];
  40.  
  41. if(lant(k)==1)
  42. {cout<<"lant";
  43. if(elementar(k)==1)
  44. cout<<"elem";
  45. else
  46. cout<<"nu e";}
  47. else
  48. cout<<"nu e lant";
  49. cout<<endl;
  50.  
  51. if(drum(k)==1)
  52. {cout<<"drum";
  53. if(elementar(k)==1)
  54. cout<<"elem";
  55. else
  56. cout<<"nu e";}
  57. else
  58. cout<<"nu e drum";
  59. cout<<endl;
  60.  
  61. if(drum(k)==1 && x[i]==x[k])
  62. {cout<<"circ";
  63. if(elementar(k-1)==1)
  64. cout<<"elem";
  65. else
  66. cout<<"nu e";}
  67. else
  68. cout<<"nu e circ";
  69. cout<<endl;
  70. for(i=1;i<=n;i++)
  71. {for(j=1;j<=n;j++)
  72. cout<<a[i][j]<<" ";
  73. cout<<endl;}
  74.  
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement