fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. int a, b, c, f, h, sumofdigits = 0, lol = 0, k;
  7. string g, ui, ul, uo;
  8. c = a - b;
  9. for(int i = 0; i < 5; i++){
  10. cin >> a >> b;
  11. string d = to_string(a);
  12. string e = to_string(b);
  13. f = d.length();
  14. int meli = stoi(f);
  15.  
  16. for(int n = 0; n < f; f--){
  17. if(f > 1){
  18. g = d[f];
  19. }
  20. else if(f == 1){
  21. g = d[1];
  22. }
  23. stoi(g) == h;
  24.  
  25. sumofdigits += h;
  26. if(sumofdigits % 2 == 0){
  27. ul = "super";
  28. }
  29. for(int me = 0; me < f; me++){
  30. if(me == 0){
  31. me = h;
  32. }
  33. else if(me > 0){
  34. if(me < h){
  35. me = h;
  36. }
  37. }
  38. else me = me;
  39. if(me == meli){
  40. ui = "special";
  41. }
  42. }
  43.  
  44.  
  45.  
  46.  
  47. }
  48. for(int l = 0; a < b; a++){
  49. for(int j = 2; j < c; j++){
  50. k = j * j;
  51. if(a % k != 0){
  52. uo == "awesome";
  53. }
  54. }
  55. if(ul == "super" && ui == "special" && uo == "awesome"){
  56. lol += 1;
  57. }
  58. else lol = lol;
  59. }
  60. cout << lol << endl;
  61. sumofdigits = 0;
  62. }
  63.  
  64.  
  65.  
  66. return 0;
  67. }
Compilation error #stdin compilation error #stdout 0s 4472KB
stdin
2 10
30 300
6666 66666
12345 67890
100000 1000000
compilation info
prog.cpp:14:14: error: no matching function for call to 'stoi'
                int meli = stoi(f);
                           ^~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/basic_string.h:5427:3: note: candidate function not viable: no known conversion from 'int' to 'const string' (aka 'const basic_string<char>') for 1st argument
  stoi(const string& __str, size_t* __idx = 0, int __base = 10)
  ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/basic_string.h:5533:3: note: candidate function not viable: no known conversion from 'int' to 'const wstring' (aka 'const basic_string<wchar_t>') for 1st argument
  stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
  ^
prog.cpp:23:11: warning: equality comparison result unused [-Wunused-comparison]
                stoi(g) == h;
                ~~~~~~~~^~~~
prog.cpp:52:7: warning: equality comparison result unused [-Wunused-comparison]
                        uo == "awesome";
                        ~~~^~~~~~~~~~~~
prog.cpp:52:7: note: use '=' to turn this equality comparison into an assignment
                        uo == "awesome";
                           ^~
                           =
2 warnings and 1 error generated.
stdout
Standard output is empty