Frame for pictures-solution
Programski jezik C
#include <stdio.h>
using namespace std;
int main()
{
int X , Y; //Frame width and height<1000
int P; // Area in mm
double P1; // Area in cm
scanf("%d%d",&X,&Y); //Input frame width and height from console
P=X*Y; // Calculation of the area of the rectangular frame in mm^2
P1=P/100.0; // Calculation of the area of the rectangular frame in cm^2
printf("%d %.2f",P,P1); /* Print the result, the first is an integer, the second is real and rounded to 2 decimal places */
return 0;
}
using namespace std;
int main()
{
int X , Y; //Frame width and height<1000
int P; // Area in mm
double P1; // Area in cm
scanf("%d%d",&X,&Y); //Input frame width and height from console
P=X*Y; // Calculation of the area of the rectangular frame in mm^2
P1=P/100.0; // Calculation of the area of the rectangular frame in cm^2
printf("%d %.2f",P,P1); /* Print the result, the first is an integer, the second is real and rounded to 2 decimal places */
return 0;
}
Programming language JAVA
public static void main(String[] args) {
int X, Y; //Frame width and height<1000
int P; // Area in mm
double P1; // Area in cm
Scanner ucitavac = new Scanner(System.in);
X = ucitavac.nextInt(); //Input frame width from console
Y = ucitavac.nextInt(); //Input frame height from console
P = X * Y; // Calculation of the area of the rectangular frame in mm^2
P1 = P / 100.0; // Calculation of the area of the rectangular frame in cm^2
System.out.printf("%d %.2f", P, P1); /* Print the result, the first is an integer, the second is real and rounded to 2 decimal places */
}
int X, Y; //Frame width and height<1000
int P; // Area in mm
double P1; // Area in cm
Scanner ucitavac = new Scanner(System.in);
X = ucitavac.nextInt(); //Input frame width from console
Y = ucitavac.nextInt(); //Input frame height from console
P = X * Y; // Calculation of the area of the rectangular frame in mm^2
P1 = P / 100.0; // Calculation of the area of the rectangular frame in cm^2
System.out.printf("%d %.2f", P, P1); /* Print the result, the first is an integer, the second is real and rounded to 2 decimal places */
}