ამოხსნების სტატუსი

ამ გვერდზე თქვენ იხილავთ გაგზავნილი ამოხსნების სტატუსს.


გაგზავნის თარიღი: 24.11.2022 19:29:27

ამოცანა: კემბრიჯი

მომხმარებელი: Levan_tamazashvili

ვერდიქტი: ამოუხსნელი

შეფასება: 0 ქულა







#include <iostream>
#include <string>
using namespace std;
int i,n,a;
string sityva;
char C,A,M,B,R,I,D,G,E;
int main() {
    C='C';
    A='A';
    M='M';
    B='B';
    R='R';
    I='I';
    D='D';
    G='G';
    E='E';
    
    cin>>sityva;
    n=sityva.size();
    
    for(i=1; i<=n; i++) {
        if (a[i]==C or a[i]==A or a[i]==M or a[i]==B or a[i]==R or a[i]==I or a[i]==D or a[i]==G or a[i]==E) {a=a.erase(i,1); i==0;}
        else i++;
                        }
    
    cout<<a;

    return 0;
}

main.cpp: In function 'int main()':
main.cpp:22:16: error: invalid types 'int[int]' for array subscript
         if (a[i]==C or a[i]==A or a[i]==M or a[i]==B or a[i]==R or a[i]==I or a[i]==D or a[i]==G or a[i]==E) {a=a.erase(i,1); i==0;}
                ^
main.cpp:22:27: error: invalid types 'int[int]' for array subscript
         if (a[i]==C or a[i]==A or a[i]==M or a[i]==B or a[i]==R or a[i]==I or a[i]==D or a[i]==G or a[i]==E) {a=a.erase(i,1); i==0;}
                           ^
main.cpp:22:38: error: invalid types 'int[int]' for array subscript
         if (a[i]==C or a[i]==A or a[i]==M or a[i]==B or a[i]==R or a[i]==I or a[i]==D or a[i]==G or a[i]==E) {a=a.erase(i,1); i==0;}
                                      ^
main.cpp:22:49: error: invalid types 'int[int]' for array subscript
         if (a[i]==C or a[i]==A or a[i]==M or a[i]==B or a[i]==R or a[i]==I or a[i]==D or a[i]==G or a[i]==E) {a=a.erase(i,1); i==0;}
                                                 ^
main.cpp:22:60: error: invalid types 'int[int]' for array subscript
         if (a[i]==C or a[i]==A or a[i]==M or a[i]==B or a[i]==R or a[i]==I or a[i]==D or a[i]==G or a[i]==E) {a=a.erase(i,1); i==0;}
                                                            ^
main.cpp:22:71: error: invalid types 'int[int]' for array subscript
         if (a[i]==C or a[i]==A or a[i]==M or a[i]==B or a[i]==R or a[i]==I or a[i]==D or a[i]==G or a[i]==E) {a=a.erase(i,1); i==0;}
                                                                       ^
main.cpp:22:82: error: invalid types 'int[int]' for array subscript
         if (a[i]==C or a[i]==A or a[i]==M or a[i]==B or a[i]==R or a[i]==I or a[i]==D or a[i]==G or a[i]==E) {a=a.erase(i,1); i==0;}
                                                                                  ^
main.cpp:22:93: error: invalid types 'int[int]' for array subscript
         if (a[i]==C or a[i]==A or a[i]==M or a[i]==B or a[i]==R or a[i]==I or a[i]==D or a[i]==G or a[i]==E) {a=a.erase(i,1); i==0;}
                                                                                             ^
main.cpp:22:104: error: invalid types 'int[int]' for array subscript
         if (a[i]==C or a[i]==A or a[i]==M or a[i]==B or a[i]==R or a[i]==I or a[i]==D or a[i]==G or a[i]==E) {a=a.erase(i,1); i==0;}
                                                                                                        ^
main.cpp:22:115: error: request for member 'erase' in 'a', which is of non-class type 'int'
         if (a[i]==C or a[i]==A or a[i]==M or a[i]==B or a[i]==R or a[i]==I or a[i]==D or a[i]==G or a[i]==E) {a=a.erase(i,1); i==0;}
                                                                                                                   ^~~~~