답안 #299141

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
299141 2020-09-14T13:59:20 Z theshadow_04 고장난 휴대전화기 (COCI14_mobitel) C++14
0 / 50
1 ms 384 KB
/** VU TRUONG AN **/
#include <bits/stdc++.h>
#define FOR(i,x,y) for(int i = x; i <= y ; ++i)
#define FORN(i,x,y) for(int i = x; i >= y ; --i)
#define F first
#define S second
#define maxn 1005
#define mp make_pair
#define pb push_back
#define ll long long
#define Task "mobitel"
using namespace std;
int a[10];
string s;

void Xuli(char aa)
{
    if(aa == 'a'|| aa == 'A')
        cout << a[2];
    if(aa == 'b'|| aa == 'B')
        cout << a[2] << a[2];
    if(aa == 'c'|| aa == 'C')
        cout << a[2] << a[2] << a[2];
    if(aa == 'd'|| aa == 'D')
        cout << a[3];
    if(aa == 'e'|| aa == 'E')
        cout << a[3] << a[3];
    if(aa == 'f'|| aa == 'F')
        cout << a[3] << a[3] << a[3];
    if(aa == 'g'|| aa == 'G')
        cout << a[4];
    if(aa == 'h'|| aa == 'H')
        cout << a[4] << a[4];
    if(aa == 'i'|| aa == 'I')
        cout << a[4] << a[4] << a[4];
    if(aa == 'j'|| aa == 'J')
        cout << a[5];
    if(aa == 'k'|| aa == 'K')
        cout << a[5] << a[5];
    if(aa == 'l'|| aa == 'L')
        cout << a[5] << a[5] << a[5];
    if(aa == 'm'|| aa == 'M')
        cout << a[6];
    if(aa == 'n'|| aa == 'N')
        cout << a[6] << a[6];
    if(aa == 'o'|| aa == 'O')
        cout << a[6] << a[6] << a[6];
    if(aa == 'p'|| aa == 'P')
        cout << a[7];
    if(aa == 'q'|| aa == 'Q')
        cout << a[7] << a[7];
    if(aa == 'r'|| aa == 'R')
        cout << a[7] << a[7] << a[7];
    if(aa == 's'|| aa == 'S')
        cout << a[7] << a[7] << a[7] << a[7];
    if(aa == 't'|| aa == 'T')
        cout << a[8];
    if(aa == 'u'|| aa == 'U')
        cout << a[8] << a[8];
    if(aa == 'v'|| aa == 'V')
        cout << a[8] << a[8] << a[8];
    if(aa == 'w'|| aa == 'W')
        cout << a[7];
    if(aa == 'x'|| aa == 'X')
        cout << a[7] << a[7];
    if(aa == 'y'|| aa == 'Y')
        cout << a[7] << a[7] << a[7];
    if(aa == 'z'|| aa == 'Z')
        cout << a[7] << a[7] << a[7] << a[7];
}
int main()
{
    ios_base::sync_with_stdio(0);
    cout.tie(0); cin.tie(0);
    for(int i = 1;i <= 9;i++)
        cin >> a[i];
    cin >> s;
    for(int i = 0;i < s.length();i++)
    {
        if(i != (s.length()-1))
        {
            Xuli(s[i]);
            cout << "#";
        }
        else Xuli(s[i]);
    }
}

Compilation message

mobitel.cpp: In function 'int main()':
mobitel.cpp:78:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   78 |     for(int i = 0;i < s.length();i++)
      |                   ~~^~~~~~~~~~~~
mobitel.cpp:80:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   80 |         if(i != (s.length()-1))
      |            ~~^~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -