Показать сообщение отдельно

  #8  
Старый 28.08.2009, 11:57
Mozy
Познающий
Регистрация: 15.03.2009
Сообщений: 77
Провел на форуме:
984248

Репутация: 73
По умолчанию

Вот 3
Код:
#include <iostream>
#include <conio.h>
#include <stdlib.h>
#include <math.h>
using namespace std;

int main(void){
float a,b,c,min,max;

cout << "a=";
cin >> a;
cout << "b=";
cin >> b;
cout << "c=";
cin >> c;

if ((a==b) || (a==c) || (b==a) || (b==c) || (c==a) || (c==b)){
   cout << "Incorrect values are entered. Can`t continue"<<endl;
   getch();
   exit(1);
}
   
if ((a>b) && (a>c)){
max=a;}
else{
   if ((b>a) && (b>c)){
   max=b;} 
   else{
      if ((c>a) && (c>b)){
      max=c;}}}
      
if ((a<b) && (a<c)){
min=a;}
else{
   if((b<a) && (b<c)){
   min=b;}
   else{
      if ((c<a) && (c<b)){
      min=c;}}}
      
if (pow(min,2)>max){
cout << "Square of min is more than max"<<endl;
getch();}
else{
   if (pow(min,2)<max){
   cout << "Square of min is less than max"<<endl;
   getch();}
   else{
      if (pow(min,2)==max){
      cout << "Square of min is equal to max" << endl;
      getch();}}}

return 0;
}
Вот 4
Код:
#include<iostream>
#include <conio.h>
using namespace std;

int main(void){
float n,i=1;
cout <<"n=";
cin >> n;

do{
i++;
}while(n%i==0);

if (n=i){
cout << n << " is simple"<<endl;
getch();}
else{
   cout<< n<<" isn`t simple"<<endl;
getch();}

return 0;
}
Вот 5
Код:
#include <iostream>
#include <math.h>
#include <conio.h>
using namespace std;

int main (void){
int i,j,n;
float pr=1;

cout << "n=";
cin >>n;
 for (i=1;i<=n;i++){
   for(j=1;j<=n;j++){
    pr=pr*sin(2*i+j*j);
   }
 }
cout << pr;
getch();

return 0;
}

Последний раз редактировалось Mozy; 28.08.2009 в 12:30..
 
Ответить с цитированием