Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GYAK10_9
- #include <iostream>
- using namespace std;
- int main()
- {
- int a,b,c,d=0;
- cin>>a;
- cin>>b;
- cin>>c;
- if (a+b>c && b+c>a && a+c>b)
- {
- cout<<"Kepezhetnek haromszoget";
- d=1;
- }
- else
- cout<<"Nem kepezhetnek haromszoget.";
- if (d==1 && (a==b || b==c || a==c))
- cout<<"Egyenlo szaru a haromszog.";
- return 0;
- }
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- GYAK10_10
- #include <iostream>
- using namespace std;
- int main()
- {
- int a,b,c,d;
- cin>>a;
- b=a/100;
- c=a/10%10;
- d=a%10;
- if (b%2==0)
- b=b/2;
- if (c%2==0)
- c=c/2;
- if (d%2==0)
- d=d/2;
- cout<<"Az uj szam:"<<b*100+c*10+d;
- return 0;
- }
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- GYAK10_11
- #include <iostream>
- using namespace std;
- int main()
- {
- int a,b,c;
- cin>>a;
- b=a/10;
- c=a%10;
- if (b==c)
- cout<<"Az uj szam:"<<b*1111;
- else
- {
- if (b<c)
- {
- b=9;
- cout<<"Az uj szam:"<<b*10+c;
- }
- else
- {
- c=9;
- cout<<"Az uj szam:"<<b*10+c;
- }
- }
- return 0;
- }
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Advertisement
Add Comment
Please, Sign In to add comment