- 博客(4)
- 收藏
- 关注
原创 python做1到100的自然数累加
python做1到100的自然数累加,并将结果保存至同目录下的txt文件s = 0i = 0for i in range(100): i = i + 1 s = s + iprint(s)with open('output.txt','w',encoding='utf-8') as fin: # 这里的encoding = 'utf-8'可以不用加 fin.write('1+2+3+4+5+6+...+99+100=') fin.write(str(s))pri
2022-03-23 19:51:48 4349
原创 根据父母身高预测女儿身高C语言代码
根据父母身高预测女儿身高C语言代码#include<stdio.h>#define DEG 0.923#define CEG 2float height(float father,float mother);int main()//定义主函数//{ //定义mother father的数据类型// float father; float mother; float daughter; printf(" \tCaculate daughter's height \n"
2022-02-10 20:42:13 857
原创 根据父母身高预测儿子身高C语言代码
根据父母身高预测儿子身高C语言代码#include <stdio.h> //预处理命令//#define HEG 0.54//定义常量0.54//float height(float father,float mother);int main(){ float father; float mother; float son; printf("please input father's height:\n"); scanf("%f",&father); prin
2022-02-10 20:38:21 3612
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人