Advertisement
Guest User

Untitled

a guest
Nov 19th, 2011
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int nr=0;
  9.     char c=0;
  10.     while (c!=13) // 13 e tasta enter
  11.     {
  12.  
  13.         c=getch();
  14.         cout<<'*';
  15.  
  16.         if (c!=13)
  17.         {
  18.             //fa ceva cu caracterul c
  19.             nr=nr*10+(c-48);
  20.         }
  21.  
  22.     }
  23.     cout<<endl;
  24.     cout<<"numarul citit este:"<<nr;
  25.     getch();
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement