

Viết chương trình thực hiện nhập vào từ bàn phím năm sinh của một người và năm hiện tại. Hãy đưa ra màn hình số tuổi hiện nay của người đó?
Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
Ý tưởng: Lấy năm hiện tại trừ đi năm sinh ra số tuổi
`Code:`
`C++:`
#include<bits/stdc++.h>
using namespace std;
int main(){
int ns,nht;
cin>>ns>>nht;
int t=nht-ns;
cout<<t;
}
`C:`
#include<stdio.h>
int main(){
int ns;
int nth;
scanf("%d",&ns);
scanf("%d",&nht);
int t=nht-ns;
printf(t);
}
`Python:`
ns=int(input())
nht=int(input())
t=nht-ns
print(t)
`Pascal:`
var
ns,nht,t:integer;
begin
readln(ns);
readln(nht);
t:=nht-ns;
writeln(t);
end.
`Ruby:`
ns=gets.to_i
nht=gets.to_i
puts nht-nsHãy giúp mọi người biết câu trả lời này thế nào?
`\color{#1AD5F7}{⋆⟡}\color{#1AD5F7}{C}\color{#4DA6E6}{h}\color{#668EDD}{i}\color{#8077D5}{p}\color{#995FCD}{p}\color{#EA2F90}{⟡⋆}`
`\text{Python}`
namsinh = int(input())
namhientai = int(input())
t = namhientai - namsinh
print(t)
`\text{C++}`
#include <bits/stdc++.h>
using namespace std;
int main() {
int namsinh, namhientai;
cin >> namsinh >> namhientai;
cout << namhientai - namsinh << endl;
return 0;
}
`\text{C}`
#include <stdio.h>
int main() {
int namsinh, namhientai;
scanf("%d %d", &namsinh, &namhientai);
printf("%d\n", namhientai - namsinh);
return 0;
}
Hãy giúp mọi người biết câu trả lời này thế nào?
Bảng tin
797
12936
1452
ns = năm sinh nht = năm hiện tại
797
12936
1452
`4` ngôn ngữ rồi nhé