题目链接:http://bailian.openjudge.cn/practice/1007

#include<stdio.h>
#include<algorithm>
using namespace std; typedef struct number{
char s[51];
int num;
}; int n,len;
number myn[101]; bool cmp( number a, number b )
{
return a.num < b.num;
}
int main()
{
scanf("%d %d",&len,&n);
for(int i=0;i<n;i++)
{
scanf("%s",myn[i].s);
myn[i].num = 0;
for(int j=0;j<len;j++)
{
if(myn[i].s[j] == 'A') continue;
for(int k=j+1;k<len;k++)
{
if(myn[i].s[j] > myn[i].s[k])
myn[i].num++;
}
}
}
sort(myn,myn+n,cmp);
for(int i=0;i<n;i++)
puts(myn[i].s);
return 0;
}

最新文章

  1. 专家解读:BPM与OA的区别
  2. SQL注入的常用函数和语句
  3. python redis使用
  4. CommonJS 模块规范 1.1.1
  5. cnblog code syntaxhighlighter view
  6. EXTJS 3.0 资料 控件之 FormPanel 插入button用法
  7. (转)Android’s HTTP Clients
  8. C/C++与lua实现互调
  9. C#打开php链接传参然后接收返回值
  10. mysql5.6.24的安装与简单使用
  11. jupyter的交互小工具-----ipyleaflet
  12. Python学习笔记【第三篇】:if判断、while循环、for循环
  13. linux 扩展根分区
  14. mongodb数据库安装及常见操作
  15. spirngboot 注解方式注入自定义参数
  16. alitomcat maven以及Autoconfig
  17. ubuntu下安装和配置最新版JDK8傻瓜教程
  18. WebApi跨域问题解决
  19. 破解Power Designer 12.5
  20. Linux操作系统下的三种Java环境配置方法

热门文章

  1. Windows2008r2、正版安装包
  2. 如何处理pom文件中没有找到HUB检查到高危漏洞的依赖包
  3. Alice and Hairdresser
  4. PP: Shallow RNNs: a method for accurate time-series classification on tiny devices
  5. chrome js报错Uncaught SyntaxError: Unexpected string
  6. python3函数的参数
  7. 全面了解 Java 原子变量类
  8. c语言 memcpy()
  9. java高精度,大数
  10. Django | Unable to get repr for &lt;class &#39;django.db.models.query.QuerySet&#39;&gt;