Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- #define n 10
- typedef struct{
- double Re;
- double Imm;
- }Complesso;
- void leggiComplex(Complesso &);
- void stampaComplex(const Complesso);
- int main(int argc, char** argv) {
- Complesso n1;
- leggiComplex(n1);
- stampaComplex(n1);
- return 0;
- }
- void leggiComplex(Complesso n1){
- cout<<"inserisci la parte reale del numero complesso: ";
- cin>>n1.Re;
- cout<<"inserisci la parte immaginaria del numero complesso: ";
- cin>>n1.Imm;
- cout<<"\n";
- }
- void stampaComplex(Complesso n1){
- cout<<"il numero complesso inserito รจ: "<<n1.Re<<"+"<<n1.Imm<<"i"<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement