當前位置:首頁 » 編程軟體 » 幫忙編程

幫忙編程

發布時間: 2022-06-20 11:27:34

1. 幫忙編程

2.
a = 4, b = 1, c = 9
a = 5, b = 1, c = 8
a = 6, b = 1, c = 7
a = 7, b = 1, c = 6
a = 8, b = 1, c = 5
a = 9, b = 1, c = 4
Press any key to continue

#include<stdio.h>
main()
{
for (int a = 0; a < 10; a++)
for (int b = 0; b < 10; b++)
for (int c = 0; c < 10; c++)
if (a * 101 + 20 * b + 101 * c == 1333)
printf("a = %d, b = %d, c = %d\n", a, b, c);
}

2. 幫忙編程(c語言

求a&&b,a||b,a&&c 結果是1。
用d=a&&b,a||b,a&&c與e=a&&b;結果一樣,都只計算a&&b,對d等式,後面a||b與a&&c沒計算(我用VC6.0調試的)。
如果a=12,b=0,c=12;
d=a&&b,a||b,a&&c;d結果為0,若d=a&&c,a||b,a&&b;d結果為1。

#include<stdio.h>
int main() {
int a,b,c,d;
a=12;
b=18;
c=12;
d=a&&b,a||b,a&&c;
printf("%d\n",d);
return 0;
}

3. 幫忙編程,用C語言編。

1.
32, 29
Press any key to continue

#include<stdio.h>

main()
{
for (int i = 30; i < 40; i++)
for (int j = 20; j < 30; j++)
if (i * i + j == 1053 && i + j * j == 873)
printf("%d, %d\n", i, j);
}

2.
#include<stdio.h>

f(int a[], int n)
{
int m = 0, s = 1, i;
for (i = 0; i < n; i++)
{
s *= a[i];
if (a[i] > m)
m = a[i];
}
for (; m <= s; m++)
{
for (i = 0; i < n; i++)
if (m % a[i])
break;
if (i == n)
return m;
}
}

main()
{
int a[] = {9, 18, 27, 3};
cout<<f(a, 4)<<endl;
}

4. 幫忙編程啊

#include <iostream>
#include <cstdlib>
using namespace std;

int main(){
double lirun;
cout<<"請輸入當月利潤:"<<flush;
cin>>lirun;
if(lirun<=100000) {
cout<<"應發放獎金總數:"<<lirun*0.1<<endl;
}else if(lirun<=200000){
cout<<"應發放獎金總數:"<<100000*0.1+(lirun-100000)*0.075<<endl;
}else if(lirun<=400000){
cout<<"應發放獎金總數:"<<100000*0.1+100000*0.075+(lirun-200000)*0.05<<endl;
}else if(lirun<=600000){
cout<<"應發放獎金總數:"<<100000*0.1+100000*0.075+200000*0.05+(lirun-400000)*0.03<<endl;
}else if(lirun<=1000000){
cout<<"應發放獎金總數:"<<100000*0.1+100000*0.075+200000*0.05+200000*0.03+(lirun-600000)*0.015<<endl;
}else{
cout<<"應發放獎金總數:"<<100000*0.1+100000*0.075+200000*0.05+200000*0.03+400000*0.015+(lirun-1000000)*0.01<<endl;
}
system("pause");
return 0;
}
//不知道你是不是這個意思……

5. 幫忙編程,急

做了個簡單的程序,看看

'添加窗體Form1,卷標Label1,按鈕Command1,Command2,然後添加如下代碼:
PrivateTypeMAN
strIDAsString
strAgeAsString
EndType
Dimm1(1To5)AsMAN

PrivateSubForm_Load()
Command1.Caption="信息錄入"
Command2.Caption="年齡查詢"
EndSub

PrivateSubCommand1_Click()
DimiAsInteger
Fori=1To5
m1(i).strAge=InputBox("請輸入第"&i&"人的年齡:","輸入年齡")
Next
Fori=1To5
m1(i).strID=InputBox("請輸入第"&i&"人的編號:","輸入編號")
Next
Command1.Enabled=False
EndSub

PrivateSubCommand2_Click()
DimiAsInteger
Dimstr1AsString
str1=InputBox("請輸入你要查看的人的編號:","輸入編號")
Fori=1To5
Ifm1(i).strID=str1Then
Label1.Caption=m1(i).strAge
ExitSub
EndIf
Next
Ifi=6Then
MsgBox"輸入的編號有誤!"
Label1.Caption="編號有誤"
EndIf
EndSub

6. 幫忙編程一下

public class Demo2 {
public static void main(String[] args) {
long a=1L;
for (int i = 0; i <18 ; i++) {
a*=10;
}
System.out.println(a);
long d;
long b=a-1;
long c;
long e=1L;
do{
c=b-1;
d=b+c;
b--;
e++;
}while(d>a);
System.out.println(e);
}
}
這是java中的代碼示例,對不起c++我不懂,思路希望你能看懂
其實答案就是(10^18)/2 -1=5*10^17-1
兩短邊之和小於第三邊就構不成三角形了
代碼可以直接修改成下面的,上邊的代碼是一個一個試呢,效率太低

7. 求大神幫忙c語言編程

#include <iostream.h>
int main()
{
int weight = 0;
float money = 0;
printf("請輸入托運行李重量");
scanf("%d",&weight);
if(weight <= 20)
{
printf("免費托運");
}
if(weight>20 && weight<=30)
{
money = (weight-20)*30;
printf("超出20公斤的部分30元/公斤,托運費用為:,%f\n",money,"元");
}
if(weight>30 && weight<=40)
{
money = 10*30+(weight-30)*40;
printf("超出30公斤的部分40元/公斤,托運費用為:,%f\n",money,"元");
}
if(weight>40 && weight<=50)
{
money = 10*30+10*40+(weight-40)*50;
printf("超出40公斤的部分50元/公斤,托運費用為:,%f\n",money,"元");
}
if(weight>50)
{

printf("超出允許范圍,不允許攜帶\n");
}
return 0;
}

8. 編程,想請大家幫幫忙

#include <stdio.h>

void main()

{

int month,day;

printf("請輸入月份:");

scanf("%d",&month);

if(month==4)

{

printf("這個月有年會活動 ");

printf("請輸入日期:");

scanf("%d",&day);

if(day<12)

printf("年會尚未舉辦 ");

else if(day==12)

printf("年會今日舉辦 ");

else

printf("年會已經舉辦 ");

}

else

printf("這個月沒有年會 ");

}


9. 幫忙編程!!

倒序輸出:iamahandsomeboy
#include<stdio.h>
main()
{
int i,array[15];
for(i=0;i<15;i++)
{scanf("%c",&array[i]);}
for(i=14;i>=0;i--)
{printf("%c ",array[i]);}
printf("\n");

}
在VC 6.0上運行

熱點內容
電腦我的世界伺服器游戲幣 發布:2025-05-16 05:27:25 瀏覽:487
索尼手機為什麼不能用安卓10 發布:2025-05-16 05:18:46 瀏覽:784
蔚來es6選擇哪些配置實用 發布:2025-05-16 05:18:05 瀏覽:130
小米如何掃碼wifi密碼 發布:2025-05-16 05:13:38 瀏覽:807
樓層密碼是什麼意思 發布:2025-05-16 05:13:37 瀏覽:13
創建文件夾失敗 發布:2025-05-16 05:12:59 瀏覽:396
電腦上如何查詢自己的配置 發布:2025-05-16 05:06:36 瀏覽:105
sql中去重 發布:2025-05-16 04:55:06 瀏覽:893
dwr上傳圖片 發布:2025-05-16 04:49:46 瀏覽:122
base64加密的圖片 發布:2025-05-16 04:35:46 瀏覽:356