0
I'm doing a program where enter something and then if I decide to change it, I can do it but I don't know what condition to use
#include <iostream> using namespace std; int main() { int cant; string num[10]; int i; int op; string mod,mod2; printf("num: "); cin >> cant; for(i = 0; i < cant; i++){ printf("\ninsert: "); cin>>num[i]; } printf("\n(1) ver num\n(2) modificar num"); printf("\n\noption: "); cin >> op; cout<<endl; switch(op){ case 1: for(i = 0; i < cant; i++) cout <<"num: "<< num[i]; break; case 2: for(i = 0; i < cant; i++){ cout <<"num: "<< num[i] << endl; } printf("\nModificar: "); cin >> mod; printf("\nPor cual: "); cin >> mod2; if(mod == num[i]){ num[i] == mod2; cout << "hh: " << num[i]; } break; } }
1 Resposta
0
Can you explain more what you want with this code