码迷,mamicode.com
首页 >  
搜索关键字:int    ( 143001个结果
冒泡法为何又错了,运行起来不对求解
#includeint main(){ int a[50],i,j,t,n; //scanf("%d%d%d%d%d",&a,&b,&c,&d,&e); printf("\n input number of date:"); scanf("%d",&n); printf("input %d munb...
分类:其他好文   时间:2015-04-15 21:16:56    阅读次数:120
对战游戏
class Program { struct player { public string name; public int hp; public int gj; public ...
分类:其他好文   时间:2015-04-15 21:16:00    阅读次数:133
100以内跟7有关数字
namespace ConsoleApplication1{ class Program { static void Main(string[] args) { int a = 1; int coun...
分类:其他好文   时间:2015-04-15 21:08:54    阅读次数:83
判断一个整数中有多少bit为1
Counting bits set (naive way)unsigned int v; // count the number of bits set in vunsigned int c; // c accumulates the total bits set in vfor (c = 0; v...
分类:其他好文   时间:2015-04-15 21:07:12    阅读次数:256
一个分数怎样约分?想知道的速度了。。。
#includeint main(){int n,m,a,b,c;printf("请输入分子和分母:\n");scanf("%d%d",&n,&m);a=n;b=m;if(n>m){do{c=a%b;a=b;b=c;}while(c!=0);n=n/a; m=m/a;} else{ do{c=b%a...
分类:其他好文   时间:2015-04-15 21:06:25    阅读次数:90
冒泡排序的三种实现
冒泡排序思想很容易理解:比较数组中相邻的两个数据,如果前面的数据比后面的数据大,就将两个数据进行交换,每循环一次,最大的数据就会被转移到最后一位。算法一实现:#includevoid Swap(int &a , int &b) { a = a ^ b ; b = a ^ b ; ...
分类:编程语言   时间:2015-04-15 21:05:18    阅读次数:149
推箱子
class Program { private static void ditu(int[, ,] dt, int i) { for (int j = 0; j < 10; j++) { f...
分类:其他好文   时间:2015-04-15 21:04:35    阅读次数:112
[Android]path绘图demo
class MyView extends View { float phase; PathEffect[] effects = new PathEffect[7]; int[] colors; private Paint paint; Path path; pub...
分类:移动开发   时间:2015-04-15 21:01:39    阅读次数:152
选择排序
选择排序的思想也比较容易理解,用一个变量控制数组的有序区和无序区,从无序区中挑选一个最小的数放到有序区的末尾,直到把无序区数据挑完为止,相关代码如下:#includevoid Swap(int &a , int &b) { a = a ^ b ; b = a ^ b ; a ...
分类:编程语言   时间:2015-04-15 20:57:24    阅读次数:132
屡败屡战,还是赢不了。求大神告诉我哪里错了
求大神告诉我哪里错了奇偶数分离时间限制:3000ms | 内存限制:65535KB难度:1描述有一个整型偶数n(2#includeint main(){int n,i=1;scanf("%d",&n);for(i=1;i<=n;){printf("%d ",i);i=i+2;}printf("\n"...
分类:其他好文   时间:2015-04-15 20:54:06    阅读次数:109
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!