Results 1 to 7 of 7

Thread: ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User martinhr's Avatar
    Join Date: Jul:2008
    Location: /dev/random
    Posts: 331

    ?

    , , , . , .
    :
    , :1- ; 2- ; 3- . .

    Code:
    #include <iostream> 	
    #include <cmath>	//			 
    #include <fstream>
    
    using namespace std;
    
    
    void strani3()   //    3  .
    {	int a,b,c;	 //  
    	double s,p;
    	cout<<"vyvedete a"<<endl; //
    	cin>>a;	//  
    	cout<<"vyvedete b"<<endl; //
    	cin>>b;	//  
    	cout<<"vyvedete c"<<endl; //
    	cin>>c; //  
    			if(a+b<c) // if-else      .
    		{ 
    			cout<<"nqma takyv triygylnik"<<endl;
    		}
    			if(a+c<b)
    		{ 
    			cout<<"nqma takyv triygylnik"<<endl;
    		}
    			if(c+b<a)
    		{ 
    			cout<<"nqma takyv triygylnik"<<endl;
    		}
    	else 
    		{
    			p=0.5*(a+b+c);
    			s=sqrt(p*((p-a)*(p-b)*(p-c))); //  
    		}
    	
    		cout<<"liceto na triygylnika e "<<s<<endl; //  
    
    		ofstream myFile("kursova_zadacha.txt");		//  
    		if(! myFile)								//   
    		{
    			cout<<"failyt nemoje da byde syzdaden";
    	
    		}
    	      else myFile<<"\nRezultata e \t"<<s<<endl; //  
    		  myFile.close();
    		
    
    }
    
    
    void strani2i1ygyl() //     2     .
    {
    	
    	int a,b;	//  
    	double s;	//  
    	double c;	//  
    	cout<<"vyvedete ednata strana"<<endl; //
    	cin>>a;//  
    	cout<<"vyvedete drugata strana"<<endl;//
    	cin>>b;//  
    	cout<<"vyvedete ygylyt mejdu tqh"<<endl;//
    	cin>>c;//  
    	if(c>=180) //    .
    	{
    		cout<<"nqma takyv triygylnik";
    	}
    	else
    	{
    		c=(sin((c*3.1415)/180)); //      
    		s=(0.5*(a*b)*c);		//  
    	}
    	cout<<"liceto na triygylnika e "<<s<<endl; //  
    
    		
    		ofstream myFile("kursova_zadacha.txt");		//  
    		if(! myFile)								//   
    		{
    			cout<<"failyt nemoje da byde syzdaden";
    	
    		}
    	      else myFile<<"\nRezultata e \t"<<s<<endl;//  
    		  myFile.close();
    }
    
    		
    
    
    
         void ygyl2i1strana() //         
    	 {
    		 int c; //  
    		 float s,a,b;
    		 cout<<"vyvedete ediniqt prilejasht ygyl v gradusi"<<endl; //
    		 cin>>a; //  
    	   	 cout<<"vyvedete drugiqt prilejashtygyl v gradusi"<<endl;//
    		 cin>>b;//  
    		 cout<<"vyvedete stranata"<<endl;//
    		 cin>>c;//  
    		a=(sin((a*3.1415)/180));  //      
    		b=(sin((b*3.1415)/180));  //      
    		s=(0.5*(c*c)*a*b)/(a+b);  //  
    		cout<<"liceto na triygylnika e "<<s<<endl;
    
    		ofstream myFile("kursova_zadacha.txt");		//  
    		if(! myFile)								//   
    		{
    			cout<<"failyt nemoje da byde syzdaden";
    	
    		}
    	      else myFile<<"\nRezultata e \t"<<s<<endl; //  
    		  myFile.close();
    		
    	 }
    
    
    
    
    void main()  //  
    {
    	char n; 
    	cout<<"\t\tIZBERETE NQKOQ OT FUNKCIITE"<<endl;  //  
    	cout<<"\t1.Namirane na lice po tri strani"<<endl;
    	cout<<"\t2.Namirane na lice po dve strani i ygyl mejdu tqh"<<endl;
    	cout<<"\t3.Namirane na lice po strana i dva prilejashti ygyla"<<endl;
    	cin>>n;  //  
    	switch(n) // switch      .
    	{
    	case'1':strani3();break;
    	case'2':strani2i1ygyl();break;
    	case'3':ygyl2i1strana();break;
    	default:cout<<"izbrete chislo ot 1 do 3"<<endl; 
    	}
    	
    }
    
    //
    !
    ThinkPad T520 ( 4243F53 ) | Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz | Crucial 8GB Ballistix Sport DDR3 @ 1333MHz | SAMSUNG 850 Pro Series ( MZ-7KE128BW ) 128GB 3-D Vertical | Seagate FireCuda Gaming SSHD 2TB ( ST2000LX001 ) | Kernel: 4.4.0-24-generic x86_64 Distro: Ubuntu 16.04 xenial

  2. #2
    Exhumator's Avatar
    Join Date: Jan:2005
    Location: Sofia
    Posts: 14,687
    Quote Originally Posted by martinhr View Post
    , .
    ?!?
    | Aorus X570 Master | Ryzen 9 5900X | Hellhound 7900XT | G.SKILL 32GB DDR4 3800 CL16 | Enermax Galaxy 1000W | SSD Corsair MP510 960GB & WD-RE3 2 x 1TB RAID0 | Pioneer BDR-209EBK | Creative X-Fi Titanium Fatal1ty & GigaWorks S750 | ViewSonic VX3276-2K-MHD |

  3. #3
    Registered User FuLLmaXx's Avatar
    Join Date: Jan:2007
    Location: UK
    Posts: 540
    Quote Originally Posted by Exhumator View Post
    ?!?
    ?

  4. #4
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    ?
    EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
    Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|

  5. #5
    Registered User martinhr's Avatar
    Join Date: Jul:2008
    Location: /dev/random
    Posts: 331
    , ,, .
    ThinkPad T520 ( 4243F53 ) | Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz | Crucial 8GB Ballistix Sport DDR3 @ 1333MHz | SAMSUNG 850 Pro Series ( MZ-7KE128BW ) 128GB 3-D Vertical | Seagate FireCuda Gaming SSHD 2TB ( ST2000LX001 ) | Kernel: 4.4.0-24-generic x86_64 Distro: Ubuntu 16.04 xenial

  6. #6
    Registered User martinhr's Avatar
    Join Date: Jul:2008
    Location: /dev/random
    Posts: 331
    .
    ThinkPad T520 ( 4243F53 ) | Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz | Crucial 8GB Ballistix Sport DDR3 @ 1333MHz | SAMSUNG 850 Pro Series ( MZ-7KE128BW ) 128GB 3-D Vertical | Seagate FireCuda Gaming SSHD 2TB ( ST2000LX001 ) | Kernel: 4.4.0-24-generic x86_64 Distro: Ubuntu 16.04 xenial

  7. #7
    ɐ-əpoɔᴉu⋂ ɐ ə anrieff's Avatar
    Join Date: Apr:2004
    Location: Sofia
    Posts: 8,448
    , , :

    Code:
    struct ThreeSides {
    	double a, b, c;
    };
    
    struct TwoSidesAndAngle {
    	double side1, side2;
    	double angle;
    };
    
    struct SideAndTwoAngles {
    	double side;
    	double angle1, angle2;
    };
    
    union Triangle {
    	ThreeSides variant1;
    	TwoSidesAndAngle variant2;
    	SideAndTwoAngles variant3;
    };
    main Triangle ( switch-).
    , Triangle t,

    Code:
    cin >> t.variant1.a;
    .

    (t) , ( t.variant*.* ).
    , . .
    "640K ught to be enough for anybody" - Bill Gates, 1981
    ::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |