母牛的故事 (C语言代码) 摘要:解题思路:先将母牛分为:大母牛、一岁母牛、二岁母牛、三岁母牛;用四个变量存起来,用循环每年更新一次四个变量,结束循环后所有母牛的数量就是四个变量之和;思路简单,算法高效,O(n)。参考代码:#incl…… 题解列表 2017年10月10日 24 点赞 7 评论 1529 浏览 评分:0.0
C语言程序设计教程(第三版)课后习题1.5 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ printf("**************************\n"); printf("HELLO …… 题解列表 2017年10月10日 0 点赞 1 评论 563 浏览 评分:0.0
C语言程序设计教程(第三版)课后习题1.6 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int x,y,z,t; scanf("%d%d%d",&x,&y,&z); t = x; if …… 题解列表 2017年10月10日 0 点赞 0 评论 787 浏览 评分:0.0
用筛法求之N内的素数。 (C++代码) 摘要:参考代码:#include <iostream> using namespace std; bool isPrime(int n); int main() { int n…… 题解列表 2017年10月10日 0 点赞 1 评论 1013 浏览 评分:0.0
字符逆序 (C语言代码) 摘要:参考代码:#include <stdio.h> int main() { char str[101]; int i; gets(str); for(i …… 题解列表 2017年10月10日 1 点赞 0 评论 990 浏览 评分:0.0
Hello, world! (C++代码) 摘要:解题思路:直接把数字转换成对应的ascii字符就可以了。注意事项:要一次输出,不能边读边输出;原题的输出样例里面应该是没有空格的,只是网页显示了空格;参考的代码自己调试的话按ctrl+z,才能输入eo…… 题解列表 2017年10月10日 6 点赞 5 评论 1894 浏览 评分:8.6
C语言考试练习题_保留字母 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ int i=0,j=0,m,s; int k,p; char arre[10…… 题解列表 2017年10月10日 0 点赞 0 评论 963 浏览 评分:0.0
求圆的面积 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ float f,k=3.141592; scanf("%f",&f); pr…… 题解列表 2017年10月10日 0 点赞 0 评论 2004 浏览 评分:8.3
C语言程序设计教程(第三版)课后习题1.5 (C语言代码) 摘要:解题思路:用循环输出"*"号注意事项:循环变量要有终值参考代码:#include<stdio.h>int main(){ for(int i=1;i<=26;i++) printf…… 题解列表 2017年10月10日 0 点赞 0 评论 808 浏览 评分:0.0
完数 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a; int m,k=0; scanf("%d",&a); for(m=1;m<a;m++) { if…… 题解列表 2017年10月10日 0 点赞 0 评论 915 浏览 评分:0.0