답안 #150592

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
150592 2019-09-01T08:41:37 Z 요까할 로뭘 은명팀(#3558, mario05092929, foja001, earthk) HicCup (FXCUP4_hiccup) C++17
0 / 100
5 ms 384 KB
#include "hiccup.h"

int HicCup(std::string S) {
    int N = S.size();
    int Hea,Cea,iea,HCea;
    for(int i =0;i<S.size();i++){
        if(S[i]=='H')Hea++;
        if(S[i]=='C')Cea++;
        if(S[i]=='!')iea++;
    }
    if(Hea == Cea)return iea/Hea;
    else return -1;
}

Compilation message

hiccup.cpp: In function 'int HicCup(std::__cxx11::string)':
hiccup.cpp:6:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i =0;i<S.size();i++){
                  ~^~~~~~~~~
hiccup.cpp:4:9: warning: unused variable 'N' [-Wunused-variable]
     int N = S.size();
         ^
hiccup.cpp:5:21: warning: unused variable 'HCea' [-Wunused-variable]
     int Hea,Cea,iea,HCea;
                     ^~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -