程式設計序,輸入英文月份名,輸出月份數字

時間 2021-05-04 07:35:24

1樓:火虎

#include

int main()

;int n;

printf("input month:\n");

scanf("%d",&n);

if((n<=12)&&(n>=1))

else

return 0;}

2樓:

提示你一下吧 具體的就不幫你編了 程式這個東西要多編才會熟練的 用switch語句就可以實現這個功能了 至於細節部分 自己考慮吧 還有注意 英文月份名是字串 就提醒這麼多了

3樓:匿名使用者

為了節省時間,我用簡寫吧

#include

#include

#define n 12

static const char *g_engmon[n] =;void main()

}fflush(stdin);

}while(1);}

4樓:賈佳佳

無能為力,我是學vb的。

5樓:

我用c++的。

#include

#include

using namespace std;

int main()

}return 0;}

c語言 輸入月份號,輸出該月的英文名

6樓:問明

例:輸入"3",則輸出"march",用指標陣列處理。

#define _crt_secure_no_warnings

#include

#include

void main() ;

printf("請輸入月份\n");

scanf("%d", &month);

for (; month < 1 || month>12; printf("您的輸入有誤,請重新輸入\n"), scanf("%d", &month));

printf("%d月的英文名為:%s\n", month, *(month + month - 1));

system("pause");

}執行效果:

system()用法:

windows作業系統下system () 函式詳解(主要是在c語言中的應用) 函式名: system

功 能: 發出一個dos命令

用 法: int system(char *command);

system函式已經被收錄在標準c庫中,可以直接呼叫

程式例:

#include

#include

int main(void)

又如:system("pause")可以實現凍結螢幕,便於觀察程式的執行結果;system("cls")可以實現清屏操作。而呼叫color函式可以改變控制檯的前景色和背景,具體引數在下面說明。

例如,用 system("color 0a"); 其中color後面的0是背景色代號,a是前景色代號。各顏色**如下:

0=黑色 1=藍色 2=綠色 3=湖藍色 4=紅色 5=紫色 6=黃色 7=白色 8=灰色 9=淡藍色 a=淡綠色 b=淡淺綠色 c=淡紅色 d=淡紫色 e=淡黃色 f=亮白色

7樓:

指標陣列

#include

int main(void);

int i;

printf("**************輸入0結束迴圈************\n");

while(1)

printf("該月的英文名為:%s\n",month[i-1]);}}

8樓:天涯醉酒人

#include

int main()

return 1;

}英語不好,將月份換成英語就行了,中間省略部分類似。

c語言 編寫程式,當輸入數月份時,顯示相應英文月份名稱。

9樓:星月小木木

#include

int main(void);

int i;

printf("**************輸入bai0結束迴圈************\n");

while(1)

printf("該月的英文專名屬為:%s\n",month[i-1]);}}

10樓:匿名使用者

#include

void main()}

編寫程式 輸入一個整數,輸出與該整型數對應的月份的英語名稱

11樓:匿名使用者

printf("情輸入一個月份的數字:");

int month;

scanf("%d",month);

switch(month)

12樓:匿名使用者

select case text1.textcase 1

print "january"

case 2

print "february"

.....

end select

求一c語言程式 用指標的方法 從鍵盤上輸入月份數字對應的輸出表示的英文 自編函式

13樓:不可能無人註冊

void main

;//自已把英文寫上。

char danci[10];//存放單詞。

printf("請輸入月份");

scanf("%d",s);

switch(*s)

printf("%s",danci);}

shell程式設計 編寫程式顯示下圖圖案。由輸入決定輸出多少行,下面是當行數為8時的情況

用printf列印固定寬度的字串預設是右對齊的。bin sh read p input the line number row for n in seq row dostr for m in seq n dostr done printf s n str done 還是python簡單 usr bi...

程式設計序,輸入整數存入一維陣列中,再按逆序重新存放後輸出。(使用指標)

t p i i 等於0 時 把 a 0 賦給 t i 變為1 p i p j 把 a 9 賦給 a 1 應該賦給 a 0 的 j 變為8 p j t 把 t a 0 的值 賦給 a 8 j 變為7 t p i i 還有用,不加 p i p j j還有用,不減 p j t int main int a...

2 用VB程式程式設計 從鍵盤上輸入整數,並放入一維陣列中,然後將其前元素與後元素對換

司寇忻 private sub command1 click dim tmp as string,tmp1 as string,a as string me.cls tmp text1.text if not isnumeric tmp then goto outerr a split tmp,if...