fork(1) download
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. const int MAX_LENGTH = 1000;
  6. const int TEN = 10;
  7. int freq[TEN];
  8. int freqN[TEN];
  9. int main() {
  10. int n;
  11. cin >> n;
  12. int copyN = n;
  13. while (copyN) {
  14. ++freqN[copyN % TEN];
  15. copyN /= TEN;
  16. }
  17. int desInN = 0, frecventa = 0;;
  18. for (int i = 0; i < TEN; ++i) {
  19. if (freqN[i] > frecventa) {
  20. desInN = i;
  21. frecventa = freqN[i];
  22. }
  23. }
  24. copyN = n;
  25. cout << n << "\n" ;
  26. for (int i = 0; i < TEN; ++i) {
  27. //cout << freqN[i] <<" " ;
  28. }
  29. char linie[MAX_LENGTH];
  30. cin.getline(linie, MAX_LENGTH);
  31.  
  32. while (cin.getline(linie, MAX_LENGTH)) {
  33. cout << linie << "\n";
  34. }
  35.  
  36.  
  37. return 0;
  38. }
  39.  
Success #stdin #stdout 0s 5324KB
stdin
1234
4^0lll&4
-32

asdfghj99(()1
stdout
1234
4^0lll&4
-32

asdfghj99(()1