
c语言
周鑫文
这个作者很懒,什么都没留下…
展开
-
C语言 用if goto求n!
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { printf("这是一个求n!的程序,请输入n:"); int n; scan原创 2017-10-17 16:33:03 · 740 阅读 · 0 评论 -
强制类型转换
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { float shixing;原创 2017-10-14 16:03:01 · 236 阅读 · 0 评论 -
改变字符型各值
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { char c1,c2,c3,c4,c5;原创 2017-10-14 16:51:40 · 261 阅读 · 0 评论 -
输出单个字符
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { char zifu1,zifu2,zifu3;原创 2017-10-14 16:58:45 · 853 阅读 · 0 评论 -
C语言 输入单个字符
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { char zifu;原创 2017-10-14 17:08:33 · 23868 阅读 · 0 评论 -
字符数据的输出
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { char fuhao='a'; int shuzi=97; printf("原创 2017-10-15 11:45:56 · 308 阅读 · 0 评论 -
C语言 字符串的输出
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { printf("%3s,%7.4s,%7.2s,%5.4s","xiaopihai原创 2017-10-15 11:56:10 · 348 阅读 · 0 评论 -
实型数据的有效位
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { float shixing=8888.88,shixing1=1111.11;原创 2017-10-15 12:22:27 · 681 阅读 · 0 评论 -
双精度有效位
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { double shuangjingdu1,shuangjingdu2,he;原创 2017-10-15 13:03:30 · 516 阅读 · 0 评论 -
输出制定小数位
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { double shilishu=12345.67890;原创 2017-10-15 13:12:56 · 251 阅读 · 0 评论 -
scanf输入
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int zhengshu1,zhengshu2,zhengshu3;原创 2017-10-15 13:20:08 · 374 阅读 · 0 评论 -
输入三角形的三边长输出面积
#include #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop *///公式area=sqrt(s*(s-bian1)*(s-bian2)*(s-bian3)),s=(bian1+bian2+bian3)原创 2017-10-15 13:49:26 · 3668 阅读 · 0 评论 -
C语言输入小写输出大写
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { char zifu;原创 2017-10-15 14:07:34 · 9079 阅读 · 1 评论 -
C语言比较两数大小
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int shu1,shu2; printf("请输入比较大小的两个数:");原创 2017-10-15 20:33:20 · 7104 阅读 · 0 评论 -
用c语言求解一元二次方程
#include #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int a,b,c;原创 2017-10-15 20:14:08 · 19429 阅读 · 7 评论 -
C语言大小写转换
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { char zifu; //声明字符型变量zifu原创 2017-10-15 21:52:18 · 3055 阅读 · 0 评论 -
C语言判断输入数正负
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int shu1,shu2; printf("请输入需要判断的数:"); sc原创 2017-10-15 21:25:02 · 20394 阅读 · 2 评论 -
C语言三数比大小
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int shu1,shu2,shu3; printf("请输入比大小的三个数:"原创 2017-10-15 20:44:17 · 1816 阅读 · 0 评论 -
c语言字符型赋予整型
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { char zifu1,zifu2;原创 2017-10-14 15:43:26 · 3175 阅读 · 0 评论 -
转义字符的使用
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { printf(" 撇n的作用是\n试验1\n");原创 2017-10-14 15:37:32 · 1120 阅读 · 0 评论 -
C语言整型溢出
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { short bianliang1,bianliang2;原创 2017-10-14 15:17:47 · 443 阅读 · 0 评论 -
C语言用while求n!
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int n,dangqianshu=1,jiecheng=1; printf("原创 2017-10-17 16:39:45 · 10198 阅读 · 0 评论 -
C语言do while实现n!
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int n,dangqianshu=1,jiechengshu=1; print原创 2017-10-17 16:45:43 · 4957 阅读 · 0 评论 -
C语言把1——100内不能被3整除的数输出
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int shu=1,dijishu=0; printf("这是1——100,不能原创 2017-10-17 16:53:54 · 17104 阅读 · 3 评论 -
c语言输出pai的近似值
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop *///pai的近似值=1-1/3+1/5-1/7+……; int main(int argc, char** argv) { double n,fenzi=原创 2017-10-17 22:20:23 · 4998 阅读 · 0 评论 -
fibonacci数列计算
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int shu1=1,shu2=1,i,n; printf("请输入数列位数的一原创 2017-10-17 22:43:13 · 397 阅读 · 0 评论 -
c语言求素数
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int a,n,i,sushu=1; printf("请输入起始与结束的数:")原创 2017-10-18 20:09:52 · 1353 阅读 · 0 评论 -
C语言 字母加4密码
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { char zifu; printf("请输入源密码:"); while((原创 2017-10-19 13:15:19 · 3145 阅读 · 0 评论 -
C语言输入一行信息
#include //输入输出头文件void main() //主函数{ printf("这是一个c程序\n"); //输出语句 system("pause"); //暂停dos窗口,显示结果}原创 2017-10-11 22:59:52 · 1790 阅读 · 0 评论 -
C语言计算两数和
#include //输入输出头文件void main() //主函数{ int weizhishu1 = 123, weizhishu2 = 456, he; //定义各变量且初始化 he = weizhishu1原创 2017-10-11 23:23:41 · 2032 阅读 · 0 评论 -
C语言求2个数中较大数
#include //输入输出头文件void main() //主函数{ int max(int shu1, int shu2); //声明max函数 int shu1, shu2, jiaod原创 2017-10-12 00:19:21 · 4664 阅读 · 0 评论 -
c语言 比较三数大小
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int weizhishu1, weizhishu2, weizhishu3,zu原创 2017-10-12 23:06:01 · 1333 阅读 · 0 评论 -
C语言 乘法计算
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int weizhishu1,weizhishu2,weizhishu3,weiz原创 2017-10-12 23:19:08 · 8096 阅读 · 0 评论 -
c语言 计算闰年
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int year,panduan; printf("请输出需要判断的年份:");原创 2017-10-12 23:30:11 · 7425 阅读 · 0 评论 -
c语言 分数阶乘计算
计算n为1~100的[(-1)^(n+1)*(1/n)]!原创 2017-10-13 11:54:20 · 4234 阅读 · 0 评论 -
计算n的阶乘
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop *//*计算n!*/ int main(int argc, char *argv[]) { printf("这是一个输出n!的程序;\n"); print原创 2017-10-13 20:26:10 · 828 阅读 · 0 评论 -
符号变量的使用
#include #include #define HONG 30 /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int changliang,ji; cha原创 2017-10-14 11:52:20 · 966 阅读 · 0 评论 -
整型定义的使用
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int bianliang1,bianliang2,he1,he2;原创 2017-10-14 15:00:21 · 397 阅读 · 0 评论 -
C语言输入成绩等级输出对应分数段
#include #include /* 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("%原创 2017-10-17 16:22:04 · 32156 阅读 · 0 评论