Powie mi ktoś, co zrobiłem źle?
#include
#include <stdio.h>
#include
#include <conio.h>
using namespace std;
int32_t x, y, m=0, ile;
char wybor;
int main()
{
for(int i=1; i<=100; i++)
{
wybor=getch();
cin >> x>>y;
switch(wybor)
{
case '+':
{
cout<<x+y;
break;
}
case '-':
{
cout<<x-y;
break;
}
case '*':
{
cout<<x*y;
break;
}
case '/':
{
while (x>=y)
{
x=x-y;
m++;
}
cout<<m;
break;
}
case '%':
{
while (x>=y)
{
x=x-y;
}
cout<<x;
break;
}
}
cout <<"_"<<endl;
}
return 0;
}
created
last reply
- 4
replies
- 1.0k
views
- 3
users
- 2
links