#2520: easy


1755143-9@g.puiching.edu.mo (P5A35蔡雋言)

School : Pui Ching Middle School
ID : 3019
IP address : [192.168.120.33]
Last Login :
2025-06-13 08:58:27
a011. 加減乘除 -- 板橋高中教學題 | From: [192.168.120.33] | Post Date : 2025-06-13 09:14

#include<bits/stdc++.h>
using namespace std;
int main() 
{
    int a, c;
    string b;
    while (cin>>a>>b>>c)
    {
        if (b == "+") cout<<a + c<<endl;
        else if (b == "-") cout<<a - c<<endl;
        else if (b == "*") cout<<a * c<<endl;
        else if (b == "/") cout<<a / c<<endl;
    }
}
 
#2521: Re:easy


1755143-9@g.puiching.edu.mo (P5A35蔡雋言)

School : Pui Ching Middle School
ID : 3019
IP address : [192.168.120.33]
Last Login :
2025-06-13 08:58:27
a011. 加減乘除 -- 板橋高中教學題 | From: [192.168.120.33] | Post Date : 2025-06-13 09:15

#include<bits/stdc++.h>
using namespace std;
int main() 
{
    int a, c;
    string b;
    while (cin>>a>>b>>c)
    {
        if (b == "+") cout<


NO NEED TO USE CHAR, JUST USE STRING BECAUSE THERE IS A SPACE.

 

 
#2562: Re:easy


1752786-4@g.puiching.edu.mo (林敬晉P5A08(JalenLam_progamer)(IQ...)

School : Pui Ching Middle School
ID : 3260
IP address : [192.168.120.33]
Last Login :
2025-06-05 11:37:15
a011. 加減乘除 -- 板橋高中教學題 | From: [192.168.120.33] | Post Date : 2025-06-13 09:48

#include<bits/stdc++.h>
using namespace std;
int main() 
{
    int a, c;
    string b;
    while (cin>>a>>b>>c)
    {
        if (b == "+") cout<


NO NEED TO USE CHAR, JUST USE STRING BECAUSE THERE IS A SPACE.

 


or switch and case

 
#2563: Re:easy


1755143-9@g.puiching.edu.mo (P5A35蔡雋言)

School : Pui Ching Middle School
ID : 3019
IP address : [192.168.120.33]
Last Login :
2025-06-13 08:58:27
a011. 加減乘除 -- 板橋高中教學題 | From: [192.168.120.33] | Post Date : 2025-06-13 09:48

#include<bits/stdc++.h>
using namespace std;
int main() 
{
    int a, c;
    string b;
    while (cin>>a>>b>>c)
    {
        if (b == "+") cout<


NO NEED TO USE CHAR, JUST USE STRING BECAUSE THERE IS A SPACE.

 


or switch and case


:|

 
#2564: Re:easy


1753422-4@g.puiching.edu.mo (P5A30廖善衡 :)

School : Pui Ching Middle School
ID : 2950
IP address : [192.168.120.33]
Last Login :
2025-06-05 11:34:59
a011. 加減乘除 -- 板橋高中教學題 | From: [192.168.120.33] | Post Date : 2025-06-13 09:48

#include<bits/stdc++.h>
using namespace std;
int main() 
{
    int a, c;
    string b;
    while (cin>>a>>b>>c)
    {
        if (b == "+") cout<


NO NEED TO USE CHAR, JUST USE STRING BECAUSE THERE IS A SPACE.

 


or switch and case


goooooood :)

E01

 
 
ZeroJudge Forum