python-輸入輸出練習題求平均成績
求平均成績(python3直譯器)
輸入學生姓名;
依次輸入學生的三門科目成績;
計算該學生的平均成績, 並列印;
平均成績保留一位小數點;
計算該學生語文成績佔總成績的百分之多少?並列印。eg: 78%;
name = input('學生姓名:') chinese = float(input('語文成績:')) math = float(input('數學成績:')) engish = float(input('英語成績:')) # 總成績 sumscore = chinese+math+engish # 平均成績 avgscore = sumscore/3 # 求百分比 chinesepercent = (chinese/sumscore) * 100 print('%s的平均成績為:%.2f' %(name,avgscore)) print('語文成績佔總成績的:%.2f%%' %(chinesepercent))
相關推薦
python-輸入輸出練習題求平均成績
求平均成績(python3直譯器) 輸入學生姓名; 依次輸入學生的三門科目成績; 計算該學生的平均成績, 並列印; 平均成績保留一位小數點; 計算該學生語文成績佔總成績的百分之多少?並列印。eg: 78%; name = input('學生姓名:') chinese = float(
已確定學生人數,輸入成績求平均成績(JAVA)
1、已確定學生人數,輸入學生成績,求平均成績程式碼為:import java.util.Scanner; public class clock { private static Scanner sc; public static void main(String[]
杭電2023 求平均成績(及一些易見的錯誤)
競賽 斷點 sco ani 今天 new 沒有 math 的人 鏈接:http://acm.split.hdu.edu.cn/showproblem.php?pid=2023 首先,想說下,這題對我來說可能是一個陰影。因為在自己學校的程序競賽中,這是第二題,當時自己
Python輸入輸出練習,運算練習,turtle初步練習
span pre lease world! square range oat sum 交互 1、Hello World!print("Hello World!") 2、簡單交互(交互式,文件式)教材P19>>> name = input("pleas
python輸入輸出練習,運算練習和turtle練習
llc forward pytho bgcolor 輸入 pre for port 輸入輸出 >>> print(‘hello‘) hello >>> a=float(input(‘輸入三角形第一邊長:‘)) 輸入三角形第一
Python輸入輸出練習
簡單 兩個 個數字 end 輸入輸出 radius -1 技術 代碼實現 Hello World! 簡單交互(交互式,文件式) 用戶輸入兩個數字,計算並輸出兩個數字之和(嘗試用一行代碼實現)。 用戶輸入三角形三邊長度,並計算三角形的面積:(海倫公式) 1 a = fl
求平均成績使用二維數組(網上找的,僅自用,非原創)
student sys read his += class a oid new stat using System;class AverageofScore{ public static void Main() { int[,] student_score=new int
2023.求平均成績
printf ++ amp mil pan u+ strong scanf nbsp #include<stdio.h> #include<string.h> double student[55],subject[9],sore[55][9]; in
Python 輸入輸出及字串處理
1.Python內建函式 Built-in Functions abs() dict()
python輸入輸出入門 A+B
描述 求兩個整數之和。 輸入 輸入資料只包括兩個整數A和B。 輸出 兩個整數的和。 樣例輸入 1 2 樣例輸出 3 a=input().split() print(int
06-Python輸入-輸出
一、輸入 1. Python2 raw_input 格式: result = raw_input(‘提示資訊’) 功能 會等待使用者輸入內容,直到使用者按下Enter 會將使用者輸入的內容當做"字串",傳遞給接收的變數 inp
hdu 求平均成績
Problem Description 假設一個班有n(n<=50)個學生,每人考m(m<=5)門課,求每個學生的平均成績和每門課的平均成績,並輸出各科成績均大於等於平均成績的學生數量。 Input 輸入資料有多個測試例項,每個測試例項的第一行包括兩
8.python輸入-輸出
1.變數的輸入 用程式碼獲取使用者通過鍵盤輸入的資訊 函式:input() 語法: 變數名稱 = input('提示資訊') 2.型別轉換函式 input()返回的是字串型別 int(x) --將x轉換為整數 float() --將x轉換為小數 3.
hdu 2023 求平均成績(c語言)
hdu 2023 求平均成績 點選做題網站連結 題目描述 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Description 假設一個班有
HDU2023 求平均成績【入門】
求平均成績 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 135296 Accepted Submis
編寫MapReduce程式示例——求平均成績
輸入檔案: 由於不識別中文,所以暫時使用姓名拼音 jiangxin 94 wangziwen 78 yangzi 83 wangkai 89 jiangxin 80 wangziwen 84 liutao 90 liutao 8
求平均成績
對於每個測試例項,輸出3行資料,第一行包含n個數據,表示n個學生的平均成績,結果保留兩位小數;第二行包含m個數據,表示m門課的平均成績,結果保留兩位小數;第三行是一個整數,表示該班級中各科成績均大於等於平均成績的學生數量。 每個測試例項後面跟一個空行。 (adsbygoo
hdu2023 求平均成績 (C語言)
Problem Description 假設一個班有n(n<=50)個學生,每人考m(m<=5)門課,求每個學生的平均成績和每門課的平均成績,並輸出各科成績均大於等於平均成績的學生數量。 Input 輸入資料有多個測試例項,每個測試例項的第一行包括兩個
hdu-求平均成績
Problem Description 假設一個班有n(n<=50)個學生,每人考m(m<=5)門課,求每個學生的平均成績和每門課的平均成績,並輸出各科成績均大於等於平均成績的學生數量。 Input 輸入資料有多個測試例項,每個測試例項的第一行包括兩個整數
杭電--------求平均成績
#include<stdio.h> #include<iostream> #include<algorithm> #include <cstring> #include <string> #include <m