fork(1) download
  1. #include <cstdio>
  2. #include <queue>
  3. #include <string>
  4. #include <iostream>
  5. using namespace std;
  6.  
  7. int main() {
  8. int d,s=0,c=0;
  9. string m,n;
  10. int ma=no=0;
  11. scanf("%d",&d);
  12. while(d--){
  13. scanf("%s %s",m,n);
  14. if(m=="chuva"){
  15. no++;
  16. if(ma==0)m++;
  17. else ma--;
  18.  
  19. }
  20. if(n=="chuva"){
  21. ma++;
  22. if(no==0)n++;
  23. else no--;
  24. }
  25.  
  26. }
  27. printf("%d %d",s,c);
  28. return 0;
  29. }
  30.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:10:9: error: ‘no’ was not declared in this scope
  int ma=no=0;
         ^~
prog.cpp:10:9: note: suggested alternative: ‘n’
  int ma=no=0;
         ^~
         n
prog.cpp:13:9: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘std::__cxx11::string’ {aka ‘std::__cxx11::basic_string<char>’} [-Wformat=]
   scanf("%s %s",m,n);
         ^~~~~~~
prog.cpp:13:9: warning: format ‘%s’ expects argument of type ‘char*’, but argument 3 has type ‘std::__cxx11::string’ {aka ‘std::__cxx11::basic_string<char>’} [-Wformat=]
prog.cpp:16:14: error: no ‘operator++(int)’ declared for postfix ‘++’ [-fpermissive]
    if(ma==0)m++;
             ~^~
prog.cpp:22:14: error: no ‘operator++(int)’ declared for postfix ‘++’ [-fpermissive]
    if(no==0)n++;
             ~^~
prog.cpp:11:7: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&d);
  ~~~~~^~~~~~~~~
prog.cpp:13:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s %s",m,n);
   ~~~~~^~~~~~~~~~~~~
stdout
Standard output is empty