백준
[2506] 점수계산
Jcoder
2018. 8. 19. 14:08
#include <iostream>using namespace std;int main(){int Testcase, i, Allcount, Count;int n;cin >> Testcase;Allcount = 0;Count = 0;for (i = 0; i < Testcase; i++){cin >> n;if (n == 1){Count++;Allcount += Count;}elseCount = 0;}cout << Allcount << endl;return 0;}