Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. #define n 10
  6. typedef struct{
  7. double  Re;
  8. double  Imm;
  9. }Complesso;
  10.  
  11.  
  12. void leggiComplex(Complesso &);
  13. void stampaComplex(const Complesso);
  14.  
  15. int main(int argc, char** argv) {
  16.     Complesso n1;
  17.     leggiComplex(n1);
  18.     stampaComplex(n1);
  19.     return 0;
  20.    
  21.    
  22. }
  23.  
  24. void leggiComplex(Complesso n1){
  25.     cout<<"inserisci la parte reale del numero complesso: ";
  26.     cin>>n1.Re;
  27.     cout<<"inserisci la parte immaginaria del numero complesso: ";
  28.     cin>>n1.Imm;
  29.     cout<<"\n";
  30. }
  31. void stampaComplex(Complesso n1){
  32.     cout<<"il numero complesso inserito รจ: "<<n1.Re<<"+"<<n1.Imm<<"i"<<endl;
  33.    
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement