December 17, 2018
The total area of trade mark
Threads: Read and write program 2 integer and print out the result of the community (+), Subtraction (-), multiplication (*), division (/). The result of dividing rounded to 2 decimal.
Input: A line of 2 integers a, b (other b 0) separated by spaces.
Output: 2 current, Recorder flow total, brand's 2 number, line after record trade volume of 2 number. The numbers on the same line separated by spaces.
For example:
input: 9 3 output: 12 6 27 3.00
You are not logged in? Log in to Submit Now!
51 Comments
Add a Comment
You must be logged in to post a comment.
input 2 integer but the check result it started to produce the real number.
solvable 3/3 is an art
puzzling over!
All very basic which you 🙂
in fact this is very basic you just declare more 1 variable of type real, then the variable that is injured 2 the severance
when you divide can be pressed into the actual type that
placing one bit injured rounding 2 digits only vs
” %.2f ” your dentist
Hix in dev-C in which I used frintf :((
Where instructions m.n injured slightly mysterious female uotput
You look in here, please: https://chamcode.net/huong-dan-nop-bai/
the injured out properly it also reported losses. too difficult so understand
forever new 2/3 huhu
Fighting 🙂
printf(“division : %d chia %d = %fn”,a,b,(float) a/b);
This strict division k a??
You see the results run as mutters. NOTE compare Test Your output and output
In Queue
In Queue
Processing
honey, I commit still faulty print queue and processing sir
Thank you, I will watch and correct.
His error and retry end, you check back to watch it.
anyone know how to make the trade 2 first test more .00 behind not, made his js
You try it this one. https://www.w3schools.com/jsref/jsref_tofixed.asp
how to out put the number located on a line separated by spaces
You use the print screen command according to your language and is formatted correctly..
His writing is not specific to sir
The thing you have to study, do it yourself. Make known what their classmates are more.
honey!!! 🙁
#include
int main()
{
int a, b;
scanf(“%d%d”, &a, &b);
printf(“%d% 2d n”, a+b, a-b);
printf(“%d %.2f n”, a*b, (float)a/b);
return 0;
}
I see all of you go sir, em right out then that, when you submit it to DC 2/3 (the 1 it's correct, the 3 right and 2 wrong ) that you do the thing 2 Its true that some are still wrong you sir, He fears me with review :((
Your attention is the number on 1 line separated by 1 spaces nhé.
oh !! I told you to think, hihihihi
cho mk hỏi sao lại có \n nhỉ // như hướng dẫn cho thì chỉ có %d %d thôi chứ??
How so
by pascal
How to print out the results rounded so by c ++ sir? (9/3=3.00)
j write this type
main.cpp: In function ‘int main()’: main.cpp:10:26: error: ‘printf’ was not declared in this scope printf(“%.2f”,(float)a/b); ^
Want to be printf, you need to have a library or sdtio.h nhé cstdio.
Where wrong sir?
1. Wrong Answer
Test Input:
0 4
Test Output:
4 -4
0 0.00
Your Output:
4 -4
0 0.0
2. Wrong Answer
Test Input:
10 1
Test Output:
11 9
10 10.00
Your Output:
11 9
10 10.0
3. Wrong Answer
Test Input:
4 7
Test Output:
11 -3
28 0.57
Your Output:
11 -3
28 0.5714285714285714
You look closely at the differences between the test output and output ngôn
Apparently to test exactly how the output of the new calculation must chamcode, Your example is the airport at the end 28 0.571428571428… while Test Output of chamcode just 28 0.57
how to 'do the numbers on the same line separated by spaces’ sir :((
a=input() in python why that ad errors?
Nếu là C++ thì các bạn có thể tham khảo sử dụng iomanip để thiết làm tròn nhé
#include
using namespace std;
int main()
{
int a,b,tong,hieu,tich;
float thuong;
China>>a>>b;
if (b!=0)
{
tong=a+b;
hieu=a-b;
tich=a*b;
thuong=(float)a/b;
}
cost<<tong<<hieu<<endl;
cost<<tich<<fixed<<setprecision(2)<<thuong<<endl;
}
Mọi người ơi cho e hỏi em làm sai chỗ nào mà test toàn 0 với ạ
nhìn your output và test output mà xem sai ở đâu.
#include
using namespace std;
int main()
{
int a,b;
China>>a>>b;
cost<<a+b<<" "<<a-b<<endl;
cost<<a*b<<" "<<setprecision(2)<<fixed<<(float)a/b;
}
Mò mãi cũng ra
mỗi lần xong một bài em toàn quay lại và vào bài khác thôi, em vừa đăng ký chưa biết cách để sang vài mới ạ
em cảm ơn anh!
như thế là đúng rồi đó. ^^
Ad xem: Nếu code đúng thì cho qua câu tiếp theo. Chứ mỗi lần quay lai vậy bất tiện quá
cái này các bạn phải tự làm thui.
chỉ em cách làm tròn 2 số thập phân của phép chia với ạ, bị dính mỗi cái đó
Dòng lệnh
a, b = map(int, input().split())
mình copy và pycham thì vào lỗi dấu phân cách.
ở 2 bài của web thì nhận, sao mình sang bài 3 nó không nhận code này nhỉ.
Bạn nào chỉ dẫn giúp mình chỗ “Input: A line of 2 integers a, b (other b 0) cách nhau bởi dấu cách.”. Cảm ơn
ơ sao nó không chấm cho mình nhỉ ?
Every day only 100 submit for everyone. The amount of submissions is limited.