Advertisement
JosepRivaille

X65880: Lletra o numero?

Feb 22nd, 2015
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. //Precondició: Hem d'entrar un caràcter alfanumèric
  5. //Postcondició: Escriu el tipus de caràcter
  6.  
  7. int main() {
  8.     char x;
  9.     cin >> x;
  10.     if (x >= 65 && x <= 90) cout << "Lletra majuscula" << endl;
  11.     else if (x >= 97 && x <= 122) cout << "Lletra minuscula" << endl;
  12.     else cout << "Numero" << endl;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement