1 条题解

  • 0
    @ 2023-3-13 11:51:13

    C :

    #include<stdio.h>
    int main()
    {
    	float m;
    	int a,b;
    	scanf("%f%d",&m,&a);
    	b=m*a;
    	printf("%.2f %d %d",m,a,b);
    	return 0;
    }
    

    C++ :

    #include <bits/stdc++.h>
    using namespace std;
    
    int main(){
        double a;
        int b,c;
        cin>>a>>b;
        c = a * b;
    	cout<<fixed<<setprecision(2)<<a<<" "<<b<<" "<<c<<endl; 
    }
    

    Pascal :

    var a:real;
    b,c:longint;
    begin
    read(a);
    read(b);
    write(a:0:2,' ',b,' ');
    c:=trunc(a*b);
    write(c);
    end.
    

    Java :

    import java.util.Scanner;
    
    public class Main {
    	public static void main(String[] args) {
    		Scanner sc = new Scanner(System.in);
    		double x = sc.nextFloat();
    		int y = sc.nextInt();
    		System.out.println(String.format("%.2f", x)+" "+y+" "+(int)(x*y));
    		
    	}
    
    }
    

    Python :

    x = float(input())
    s = int(input())
    su = x * s
    print(str('%.2f' % x) + ' ' + str('%d' % s) + ' ' + str('%d' % su))
    
    • 1

    信息

    ID
    1759
    时间
    1000ms
    内存
    16MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者