Can this program be shortened any further?
I basicallly need to write a program that reads in two numbers and a char.
eg. 10 + 10
then outputs its value.... The char can either be + or - or *. The number will always be less than 100. and you cannot use semicolons... :(
The input consists of int n which tells me how many test cases and then n number of a, b and c. Output should be on a new line. (ie. I need that endl there)
#include<list.h>
int main(char c,int a,int b,int n)
{if(cin>>n)
while(n!=0)
if(cin>>a>>c>>b){
if(c==42)
if(cout<<a*b<<endl){}
if (c==43)
if(cout<<a+b<<endl){}
if(c==45)
if(cout<<a-b<<endl){}
if(n--){}
}}
that is what I have so far... any help is appreciated =)
185 characters. :P