Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
93919 只因你太美(Ikun 真爱粉) 22计算算术表达式 C++ Accepted 1 MS 272 KB 573 2024-10-19 15:27:22

Tests(2/2):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() #include<string> using namespace std; int main(){ char b; int n; cin>>n; int a,c; for(int i=0;i<n;i++){ cin>>a>>b>>c; if(b=='/')cout<<a/c<<endl; if(b=='+')cout<<a+c<<endl; if(b=='*')cout<<a*c<<endl; if(b=='-')cout<<a-c<<endl; if(b=='%')cout<<a%c<<endl; } return 0; }