1.14
来源:互联网 发布:千兆路由器 知乎 编辑:程序博客网 时间:2024/05/21 15:05
#include<iostream>
#include <string>
using namespace std;
template<typename T>
void M(T s[])
{
T temp;
int i,j;
for(i=0;i<5-1;i++)
for(j=0;j<5-i-1;j++)
if(s[j]>s[j+1])
{
temp=s[j+1];
s[j+1]=s[j];
s[j]=temp;
}
for(i=0;i<5;i++)
cout<<s[i]<<endl;
}
int main()
{
int i;
int s[5];
cout<<"输入五个整形\n";
for(i=0;i<5;i++)
cin>>s[i];
M(s);
float n[5];
cout<<"输入五个单精度型\n";
for(i=0;i<5;i++)
cin>>n[i];
M(n);
double x[5];
cout<<"输入五个双精度型\n";
for(i=0;i<5;i++)
cin>>x[i];
M(x);
return 0;
}
#include <string>
using namespace std;
template<typename T>
void M(T s[])
{
T temp;
int i,j;
for(i=0;i<5-1;i++)
for(j=0;j<5-i-1;j++)
if(s[j]>s[j+1])
{
temp=s[j+1];
s[j+1]=s[j];
s[j]=temp;
}
for(i=0;i<5;i++)
cout<<s[i]<<endl;
}
int main()
{
int i;
int s[5];
cout<<"输入五个整形\n";
for(i=0;i<5;i++)
cin>>s[i];
M(s);
float n[5];
cout<<"输入五个单精度型\n";
for(i=0;i<5;i++)
cin>>n[i];
M(n);
double x[5];
cout<<"输入五个双精度型\n";
for(i=0;i<5;i++)
cin>>x[i];
M(x);
return 0;
}
0 0
- 1.14
- 1.14
- 1.14
- 1.14
- 1.14
- 1.14
- 1.14
- 1.14
- yii1.1.14
- Rapidshare Download Direct 1.14
- SICP 1.13&1.14 solution
- heritrix-1.14.4 配置
- 本周计划1.7-1.14
- Heritrix-1.14.0安装
- 第一章 概述 1.14实现
- Heritrix-1.14.4
- cairo编译 1.14.2
- 1.13和1.14
- 设置修改CentOS系统时区
- Best Cow Line(POJ-3617)
- cocos2d-x3.2 在Windows下打包Android平台APK
- 只允许ajax请求
- android控件之ListView 全教程
- 1.14
- 深入Spark内核:任务调度(3)-TaskScheduler
- LeetCode:Median of Two Sorted Arrays
- MySQL命令收集
- 页面缓存设置
- [转]设置修改CentOS系统时区/时间
- 信号量与PV操作
- MySQL5.6主从复制
- 使用eclipse查看hadoop源码