fork download
  1. int cnt = 0, tmp = 0;
  2. for (int i = 0; i < n; i++)
  3. {
  4. if (s[i] - '0')
  5. {
  6. cnt++;
  7. }
  8. else
  9. {
  10. tmp += cnt;
  11. }
  12. }
Compilation error #stdin compilation error #stdout 0s 5284KB
stdin
Standard input is empty
compilation info
prog.cpp:2:1: error: expected unqualified-id before ‘for’
 for (int i = 0; i < n; i++)
 ^~~
prog.cpp:2:17: error: ‘i’ does not name a type
 for (int i = 0; i < n; i++)
                 ^
prog.cpp:2:24: error: ‘i’ does not name a type
 for (int i = 0; i < n; i++)
                        ^
stdout
Standard output is empty