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

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


გაგზავნის თარიღი: 15.05.2019 13:30:17

ამოცანა: მძიმეების ჩამატება

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

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

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







#include <iostream>
using namespace std;
int a,b,c,i;
string a;
main() {
    cin>>a;
    b=a.size();
    if (n%3==0) c=3; else c=n%3;
    for (i=0;i<b;i++) {cout<<a[i];
    if (i==c-1 && i!=b-1)
    {cout<<","<<c=c+3;
    }
    
    
}
PROB_cpp_UID378PID19_1c2e19/main.cpp:4:8: error: conflicting declaration 'std::__cxx11::string a'
 string a;
        ^
PROB_cpp_UID378PID19_1c2e19/main.cpp:3:5: note: previous declaration as 'int a'
 int a,b,c,i;
     ^
PROB_cpp_UID378PID19_1c2e19/main.cpp: In function 'int main()':
PROB_cpp_UID378PID19_1c2e19/main.cpp:7:9: error: request for member 'size' in 'a', which is of non-class type 'int'
     b=a.size();
         ^~~~
PROB_cpp_UID378PID19_1c2e19/main.cpp:8:9: error: 'n' was not declared in this scope
     if (n%3==0) c=3; else c=n%3;
         ^
PROB_cpp_UID378PID19_1c2e19/main.cpp:9:33: error: invalid types 'int[int]' for array subscript
     for (i=0;i<b;i++) {cout<<a[i];
                                 ^
PROB_cpp_UID378PID19_1c2e19/main.cpp:11:21: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int')
     {cout<<","<<c=c+3;
                     ^
In file included from /usr/include/c++/6/iostream:39:0,
                 from PROB_cpp_UID378PID19_1c2e19/main.cpp:1:
/usr/include/c++/6/ostream:402:7: note: candidate: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator=(std::basic_ostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]
       operator=(basic_ostream&& __rhs)
       ^~~~~~~~
/usr/include/c++/6/ostream:402:7: note:   no known conversion for argument 1 from 'int' to 'std::basic_ostream<char>&&'
PROB_cpp_UID378PID19_1c2e19/main.cpp:15:1: error: expected '}' at end of input
 }
 ^