Non so quale sia il problema, aiuto pls
Codice
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
ifstream in("input.txt");
ofstream out("output.txt");
int main(){
string n = "", n_180 = "";
string v[10] = {"0", "1", "2", "-1", "-1", "5", "9", "-1", "8", "6"};
in >> n;
int c = 0;
for(int i = n.length() - 1; i > -1; i --){
if(n[n.length() - 1] - '0' == 0){
i = -1;
c = -1;
}
if(v[n[i] - '0'] == "-1"){
i = -1;
c = -1;
}
else n_180 += v[n[i] - '0'];
}
if(c == -1) out << n;
else out << n_180;
}