Как писать решения на разных языках программирования
C++
#include <cstdio>
using namespace std;
int main()
{
int a;
long long b;
float c;
double d;
scanf("%d%lld%f%lf", &a, &b, &c, &d);
printf("%lld\n%f %.2lf", b - a, c, d);
return 0;
}
C++
#include <iostream>
using namespace std;
int main()
{
int a;
long long b;
float c;
double d;
cin >> a >> b >> c >> d;
cout << b - a << '\n' << c << " " << d;
return 0;
}
C
#include <stdio.h>
int main()
{
int a;
long long b;
float c;
double d;
scanf("%d%lld%f%lf", &a, &b, &c, &d);
printf("%lld\n%f %lf", b - a, c, d);
return 0;
}
Java
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int a;
long b;
float c;
double d;
Scanner in = new Scanner(System.in);
a = in.nextInt();
b = in.nextLong();
c = in.nextFloat();
d = in.nextDouble();
System.out.println(b - a);
System.out.println(c + " " + d);
in.close();
}
}
Python
# Example code for counting sum of input numbers
print sum(int(x) for x in raw_input().split(' '))