某运输公司对货量与运费的关系有如下规定:若货物的重量超过30吨,不予邮寄;对可以运输的货物加收手续费0.2千元,再加上根据下表按重量wei计算的结果:
#include<bits/stdc++.h>
using namespace std;
int main()
{
float wei,x;
cin>>wei;
if (wei>30)
cout<<-1;
else
if (wei<=10)
cout<<wei*0.80+0.2;
if (wei>10 && wei<=20)
cout<<wei*0.75+0.2;
if (wei>20 && wei<=30)
cout<<wei*0.70+0.2;
}
#include<stdio.h>
int main()
{
int a,b,c,d,x;
printf("可能的结果有:\n");
for(x=1000;x<=9999;x++)
{
a=(x/1000)%10;
b=(x/100)%10;
c=(x/10)%10;
d=x%10;
if(a==b)
if(c+d==6)
if(x%2==0)
printf("x=%d ",x);
}
return 0;
}