uva 299
来源:互联网 发布:淘宝运营加薪申请 编辑:程序博客网 时间:2024/06/08 02:53
#include <stdio.h>int cases;int len;int tot;int store[55];int main(){int i, j;int tmp;scanf("%d", &cases);while(cases--){scanf("%d", &len);for(i = 0; i < len; i++){scanf("%d", &store[i]);}tot = 0;for(i = 0; i < len; i++){for(j = 0; j < len - i - 1; j++){if(store[j] > store[j+1]){tmp = store[j];store[j] = store[j+1];store[j+1] = tmp;++tot;}}}printf("Optimal train swapping takes %d swaps.\n", tot);}return 0;}
- uva--299
- uva-299
- uva 299
- uva 299
- uva-299
- uva 299
- Uva 299
- UVA 299
- UVa 299 Train Swapping
- Uva 299 Train Swapping
- uva 299 Train Swapping
- UVA 299 - Train Swapping
- UVA 299-Train Swapping
- UVa 299 - Train Swapping
- uva-299 - Train Swapping
- UVA 299 列车交换
- UVa 299 - Train Swapping
- UVa 299 - Train Swapping
- GSL特殊函数
- CGI Python 获取HttpRequest数据方式
- JS微信打飞机游戏(一)
- 线性表的创建与删除程序
- Centos6.4成功安装KScope1.6.2
- uva 299
- Temple与Strategy结合使用去掉继承体系
- 关于typedef int (*pFunc)(int, int)
- uva 3708
- GSL特殊函数2
- 零基础学数据结构正在改版,请读者朋友们耐心等待下
- uva 424
- Understand Rails Authenticity Token
- hdu 4341 gold miner