编写一个程序这个要怎么做

编写一个程序,输入变量n1、n2、n3的值,输出表达式n1*(n2+n3)的值

#include <iostream>
using namespace std;
int main()
{
double n1,n2,n3;
cin >> n1 >> n2 >> n3;
cout << n1*(n2+n3);
return 0;
}

#include <iostream>
using namespace std;
int main()
{
      int n1,n2,n3;
      cin>>n1>>n2>>n3;
      cout<<n1*(n2+n3)<<endl;
      return 0;
}

#include<cstdio>

double n1,n2,n3;

int main()
{
    scanf("%lf%lf%lf",&n1,&n2,&n3);
    
    printf("%lf",n1*(n2+n3));
} 
#include<cstdio>

int n1,n2,n3;

int main()
{
    scanf("%d%d%d",&n1,&n2,&n3);
    
    printf("%d",n1*(n2+n3));
} 

你试下这两个代码哪个可以