fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. string s;
  5. char c;
  6.  
  7. int main() {
  8. int s;
  9. if(s.size()<26) cout<<-1<<endl;
  10.  
  11. else{
  12. for(int i=0; i<s.size(); i++) {
  13. if(s[i]<=c) s[i]=c; c++;
  14. if(c> 'z') return cout <<s<<endl;
  15. else cout<<-1<<endl ;
  16. }
  17.  
  18. }
  19.  
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
aacceeggiikkmmooqqssuuwwyy
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:9:10: error: request for member ‘size’ in ‘s’, which is of non-class type ‘int’
     if(s.size()<26) cout<<-1<<endl;
          ^~~~
prog.cpp:12:25: error: request for member ‘size’ in ‘s’, which is of non-class type ‘int’
        for(int i=0; i<s.size(); i++) {
                         ^~~~
prog.cpp:13:17: error: invalid types ‘int[int]’ for array subscript
           if(s[i]<=c) s[i]=c; c++;
                 ^
prog.cpp:13:26: error: invalid types ‘int[int]’ for array subscript
           if(s[i]<=c) s[i]=c; c++;
                          ^
prog.cpp:14:39: error: cannot convert ‘std::basic_ostream<char>::__ostream_type’ {aka ‘std::basic_ostream<char>’} to ‘int’ in return
           if(c> 'z') return cout <<s<<endl;
                                       ^~~~
stdout
Standard output is empty