#include <iostream> using namespace std; char carattere(int i); int main() { int val; cout << "scrivi un numero intero (da 0 a 5) : " << endl; cin >> val; cout << carattere(val) << endl; cout << " " << endl; cout << " " << endl; } char carattere (int i) { if (i == 0) cout << "love"; if ( i == 1) cout << " emptyness"; if (i == 2) cout << " no sense"; if (i == 3) cout << " hug a kitty"; if (i == 4) cout << " lost soul"; if (i == 5 ) cout << " stop"; return 0; }
if (i == 0) cout << "love"; else if ( i == 1) cout << " emptyness"; else if (i == 2) cout << " no sense"; ...
#include <stdlib.h> long random(void); void srandom(unsigned int seed);