a_blaze
پنج شنبه 01 اسفند 1392, 13:50 عصر
سلام. ببخشد من همش ای ارور رو میگیرم نمیدونم از چیه؟
#include "stdafx.h"
#include <conio.h>
#include <iostream>
int _tmain(int argc, _TCHAR* argv[])
{
float H, D, x, y;
std::cin >> D >> H;
x = D - H;
if (500 < x && x > 1000);
{
y = (x * 10) / 100;
}
else
{
if (1000 < x && x > 5000);
{
y = (x * 15) / 100;
}
else
{
if (5000 < x && x > 10000);
{
y = (x * 2) / 100;
}
else
{
std::cout << "unknown value";
}
}
}
std::cout << y;
return 0;
}
#include "stdafx.h"
#include <conio.h>
#include <iostream>
int _tmain(int argc, _TCHAR* argv[])
{
float H, D, x, y;
std::cin >> D >> H;
x = D - H;
if (500 < x && x > 1000);
{
y = (x * 10) / 100;
}
else
{
if (1000 < x && x > 5000);
{
y = (x * 15) / 100;
}
else
{
if (5000 < x && x > 10000);
{
y = (x * 2) / 100;
}
else
{
std::cout << "unknown value";
}
}
}
std::cout << y;
return 0;
}