josiftepe

Untitled

Nov 15th, 2020
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream> // input/output stream
  2. #include <fstream> // file stream
  3. using namespace std;
  4. int main()
  5. {
  6. int niza[10];
  7. int y=0;
  8. for(int i=0; i<10; i+=1){
  9.     cin>>niza[i];
  10. }
  11.  
  12. for(int u=0; u<10; u+=1){
  13.     niza[u]%=42;
  14. }
  15.  
  16. for(int o=0; o<10; o+=1){
  17.     for(int l=o+1; l<10; l+=1){
  18.         if(niza[o]>niza[l]){
  19.             swap(niza[o],niza[l]);
  20.         }
  21.     }
  22. }
  23.  
  24. for(int i=0; i<10; i+=1){
  25. if(niza[i]==niza[i+1]){
  26. y+=0;
  27. }
  28. else if (niza[i]!=niza[i+1]){
  29. y+=1;
  30. }
  31. }
  32. cout<<y;
  33.  
  34.     return 0;
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment