Submission #495225

#TimeUsernameProblemLanguageResultExecution timeMemory
495225kappaSifra (COCI21_sifra)C++14
50 / 50
1 ms204 KiB
#include <bits/stdc++.h> using namespace std; set<string> q; string strr; int main(){ cin >> strr; for (int i = 0; i < strr.length(); i++) { if(isdigit(strr[i])){ string temp; int j = i; while(j < strr.length()) { if(isdigit(strr[j])){ temp += strr[j]; }else{ break; } j++; } i = j; q.insert(temp); } } cout << q.size(); }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:12:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |     for (int i = 0; i < strr.length(); i++)
      |                     ~~^~~~~~~~~~~~~~~
Main.cpp:19:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |             while(j < strr.length())
      |                   ~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...