14312022-09-22 00:30:03tomi7Morze (60 pont)cpp11Elfogadva 60/603ms3440 KiB
#include <bits/stdc++.h>
using namespace std;
 
 
int main(){
    string s;
    cin>>s;
    int n=s.size();
    int j=0;
    for(int i=0;i<n/5;i++){
         if(s[j]=='-' && s[j+1]=='-' && s[j+2]=='-' && s[j+3]=='-' && s[j+4]=='-'){
             cout<<0;
         }
         if(s[j]=='.' && s[j+1]=='-' && s[j+2]=='-' && s[j+3]=='-' && s[j+4]=='-'){
             cout<<1;
         }
         if(s[j]=='.' && s[j+1]=='.' && s[j+2]=='-' && s[j+3]=='-' && s[j+4]=='-'){
             cout<<2;
         }
         if(s[j]=='.' && s[j+1]=='.' && s[j+2]=='.' && s[j+3]=='-' && s[j+4]=='-'){
             cout<<3;
         }
         if(s[j]=='.' && s[j+1]=='.' && s[j+2]=='.' && s[j+3]=='.' && s[j+4]=='-'){
             cout<<4;
         }
         if(s[j]=='.' && s[j+1]=='.' && s[j+2]=='.' && s[j+3]=='.' && s[j+4]=='.'){
             cout<<5;
         }
         if(s[j]=='-' && s[j+1]=='.' && s[j+2]=='.' && s[j+3]=='.' && s[j+4]=='.'){
             cout<<6;
         }
         if(s[j]=='-' && s[j+1]=='-' && s[j+2]=='.' && s[j+3]=='.' && s[j+4]=='.'){
             cout<<7;
         }
         if(s[j]=='-' && s[j+1]=='-' && s[j+2]=='-' && s[j+3]=='.' && s[j+4]=='.'){
             cout<<8;
         }
         if(s[j]=='-' && s[j+1]=='-' && s[j+2]=='-' && s[j+3]=='-' && s[j+4]=='.'){
             cout<<9;
         }
         j+=5;
    }
    cout<<'\n';
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
base60/60
1Elfogadva0/03ms1812 KiB
2Elfogadva0/02ms2004 KiB
3Elfogadva3/32ms2204 KiB
4Elfogadva3/32ms2412 KiB
5Elfogadva3/32ms2768 KiB
6Elfogadva3/32ms2704 KiB
7Elfogadva3/32ms3088 KiB
8Elfogadva3/32ms3016 KiB
9Elfogadva4/42ms3208 KiB
10Elfogadva4/42ms3336 KiB
11Elfogadva4/42ms3304 KiB
12Elfogadva7/72ms3312 KiB
13Elfogadva7/72ms3308 KiB
14Elfogadva8/82ms3312 KiB
15Elfogadva8/82ms3440 KiB