C語言輸入成績等級輸出對應分數段
#include <stdio.h> #include <stdlib.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char *argv[]) { int chengji; printf("請輸入成績:"); scanf("%C",&chengji); switch(chengji) { case 'A':printf("85-100\n");break; case 'B':printf("70-84\n");break; case 'C':printf("60-69\n");break; case 'D':printf("<60\n");break; default: printf("輸入錯誤。\n"); } return 0; }
相關推薦
C語言輸入成績等級輸出對應分數段
#include <stdio.h> #include <stdlib.h> /* run this program using the console pauser or
c語言 要求按照考試成績的等級輸出百分制分數段,成績的等級由鍵盤輸入
分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!  
c語言:要求按照考試成績的等級輸出百分制分數段,成績的等級由鍵盤輸入。
要求按照考試成績的等級輸出百分制分數段,A等為85分以上,B等為70~84分,C等為60~69分,D等為60分以下。成績的等級由鍵盤輸入。解:程式:#include<stdio.h>int
【c語言】要求按照考試成績的等級輸出百分制分數段
// 要求按照考試成績的等級輸出百分制分數段,A等為85分以上,B等為70~84分, // C等為60~69分,D等為60分以下。成績的等級由鍵盤輸入 #include <stdio.h> int main() { char ch; printf("請輸
c語言輸入年月日,輸出該日為該年中的第多少天
#include <stdio.h>int main(){int year=0;int mouth=0;int day=0;int sun=0;printf("請輸入年月日");scanf("%d %d %d",&year,&mouth,&
【java基礎程式題-002】編寫功能要求按照考試成績的等級輸出百分制分數段。
題目要求:,A等為85分以上,B等為70~84分,C等為60~69分 ,D等為 60分以下 。成績的等級由鍵盤輸入。import java.io.*; public class Grade {
c語言 輸入年月日,輸出它是本年第幾天
#include <stdio.h> int main() { int year,month,day;//年月日 int i; int sum = 0;//標記天數
c語言實現輸入成績,輸出評分
方法一: #include <stdio.h> int main() { int a; printf("請輸入成績\n"); scanf("%d",&a); if(a>100||a<0) { printf("輸入錯誤
C語言 輸入一個小數,輸出它的立方。輸出保留小數點後的2位數字
c //輸入一個小數,輸出它的立方。輸出保留小數點後的2位數字。 #include <stdio.h> int main(int argc, const char * argv[]) { double i,t; printf("輸入一個小數:\n"); scanf("%lf
機試練習總結06:c語言輸入&輸出&文件讀寫
putchar 錯誤 std 機試 open() 返回 oid eof getchar 一、標準文件 c語言把所有設備當作文件。 stdin:鍵盤、標準輸入 stdout:屏幕、標準輸出 stderr:您的屏幕、標準錯誤 頭文件:stdio.h 二、getchar() &a
C語言輸入與輸出總結
1. scanf輸入: 特點:除%c外,讀取輸入時會跳過非白字元前的所有空白字元,然後一直讀取字元,直到空白字元或正在讀取字元不匹配的字元.(不匹配的會丟入緩衝區.作為下一次輸入接收的字元). 技巧: ①:把*放在%和轉換字元之間時,可以讓scanf()跳過相應輸出項. 比如:sca
C語言——輸入輸出
資料的輸入輸出 輸入:從輸入裝置(如鍵盤,磁碟,光碟,掃描器等)向計算機輸入資料。 輸出:從計算機向輸出裝置(如顯示器,印表機等)輸出資料。 (一)用printf函式輸出資料 printf函式是格式輸出函式。程式設計人員必須指定輸出資料的格式,即根據資料的不同型別指定不同的格式。 p
C語言 輸入一個不大於五位的數字,先判斷是幾位數字,然後將其數字順序輸出和逆序輸出
#include <stdio.h> #include <math.h> void main() { int function(int a); int x,w,y,A[5]; printf("請輸入一個1至99999的整數
C語言輸入十個數,任意相鄰的兩個數不同,輸出所有的遞增,遞減序列
int main(int argc, const char *argv[]) { int a[10]; for (int i=0; i<10; i++) { scanf("%d", &a[i]); } printf("%d ", a[0]);
c語言 輸入兩個人數 輸出兩個數的積
/* Input two numbers, output the product */ #include <stdio.h> main() {int x,y,m; /* 定義整型變數x,y,m */printf("Please input x and y\n")
C語言輸入輸出函式總結
在C語言中,輸入輸出函式有著相當重要的地位,它是我們的程式與使用者互動的唯一途徑,現在我就將C語言中比較常見的幾個輸入輸出函式介紹給大家,以下這些講解都是針對VC除錯平臺。 (一) 格式化輸入輸出函式 (1)scanf( )格式化輸入函式 格式輸入函式scanf( )函
c語言輸入輸出函式printf與scanf的用法格式
一樣多, 各引數之間用","分開, 且順序一一對應, 否則將會出現意想不到的錯誤。 1. 格式化規定符 Turbo C2.0提供的格式化規定符如下: ━━━━━━━━━━━━━━━━━━━━━━━━━━ 符號 作用 ───────────────
C語言輸入一個字串,輸出字串的所有組合
#include <stdio.h> #include <string.h> #define MAXSTRING 160 /************************************* Author: Stat&陳 ******
C語言輸入輸出總結
C語言中基本的輸入輸出函式有:putchar ():把變數中的一個字元常量輸出到顯示器螢幕上;getchar ();從鍵盤上輸入一個字元常量,此常量就是該函式的值;printf ();把鍵盤中的各類資料,加以格式控制輸出到顯示器螢幕上;scanf ();從鍵盤上輸入各類
C語言輸入輸出
但是 type turn 在屏幕上 return 查看 一個 ade 輸出 getchar() & putchar() 函數 int getchar(void) 函數從屏幕讀取下一個可用的字符,並把它返回為一個整數。這個函數在同一個時間內只會讀取一個單一的字符。您