Vzorové zdrojové soubory k úloze Součin
C:
#include <stdio.h>
/*
Ilustracni priklad pro PILSPROG
netrvalo
Time&date: 20:51 6.8.2007
Provede soucin n dvojic zadanych celych cisel
*/
int main(void) {
int i;
int a, b;
scanf("%d", &i);
for (; i > 0; i--) {
scanf("%d", &a);
scanf("%d", &b);
printf("%d\n", a * b);
}
return 0;
}
C++:
#include <iostream>
/*
Ilustracni priklad pro PILSPROG
Provede soucin n dvojic zadanych celych cisel
*/
int main() {
int pocet, a, b;
std::cin >> pocet;
while (pocet-- > 0) {
std::cin >> a >> b;
std::cout << a*b << std::endl;
}
return 0;
}
Java:
import java.util.*;
/**
* Ilustracni priklad pro PILSPROG
* @author netrvalo
* @version Time&date 20:51 6.8.2007
*/
public class AxB {
/**
* Provede soucin n dvojic zadanych celych cisel
* @param args parametry prikazove radky - nevyuzito
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
for (int i=sc.nextInt(); i>0; i--){
System.out.println(sc.nextInt() * sc.nextInt());
}
}
}
Pascal:
Program AxB;
{
***************************************************
* Ilustracni priklad pro PILSPROG *
* netrvalo *
* Time&date: 20:51 6.8.2007 *
* Provede soucin n dvojic zadanych celych cisel *
***************************************************
}
var
i, n: integer;
a, b: longint;
begin
read(n);
for i := 1 to n do
begin
read(a, b);
writeln(a * b);
end
end.