A题

#include <stdio.h>
#include <stdlib.h>
#define max 1000
__int64 a[max] = {0,1,1};
int main()
{
int i,n;
scanf("%d",&n); for(i = 3;i<=n;i++){
a[i] = a[i-1]+a[i-2]; }
//printf("%d",a[5]); for(i = n;i>=1;--i){
printf("%I64d\n",a[i]);
}
return 0;
}

B题

#include <stdio.h>
#include <stdlib.h>
#define max 1001
__int64 a[max]; int main()
{
int n,i,j;
__int64 t;
int flag = 0;
//scanf("%d",&n);
for(i = 0;i<10;i++){
scanf("%I64d",&a[i]);
}
for(i = 0;i<10-1;i++){
for(j = 0;j<10-i-1;j++){
if(a[j]>a[j+1]){
t = a[j+1];
a[j+1] = a[j];
a[j] = t;
}
}
} for(i = 0;i<10;++i){
if(!flag){
printf("%I64d",a[i]);
flag = 1;
}else{
printf(" %I64d",a[i]);
}
}
printf("\n");
return 0;
}

C题

#include <stdio.h>
#include <stdlib.h>
#define ma 55
int a[ma][ma],max[ma],min[ma]; int main()
{
//freopen("in.txt","r",stdin);
int i,j,n,m,judge=0,k=0;
scanf("%d%d",&n,&m);
for(i = 0;i<n;++i){
for(j = 0;j<m;++j){
scanf("%d",&a[i][j]); }
}
for(i = 0;i<n;i++){
max[i] = a[i][0];
}
for(i = 0;i<m;++i){
min[i] = a[0][i];
}
for(i = 0;i<n;++i){
for(j = 0;j<m;++j){
if(a[i][j]>max[i]){
max[i] = a[i][j];
}
if(a[i][j]<min[j]){
min[j] = a[i][j];
}
}
}
for(i = 0;i<n;i++){
for(j = 0;j<m;j++){
if(max[i] == min[j]){
judge = 1;
printf("%d %d %d\n",i,j,a[i][j]);
break;
}
}
if(judge){
break;
}
}
if(!judge){
printf("It does not exist!\n");
}
return 0;
//fclose(stdin);
}

D题

#include <stdio.h>
#include <stdlib.h>
#define max 50
int a[max][max]={0};
int b[max][max]={0};
int main()
{
int n,i,j,k,flag = 0;
scanf("%d",&n);
for(i = 0;i<n;i++){
for(j = 0;j<=i;j++){
if(j==i || !j ){
a[i][j] = 1;
}else{
a[i][j] = a[i-1][j-1]+a[i-1][j];
}
}
}
//for(i = 0;i<n;i++){
// for(j = 0;j<=i;j++){
// printf(" %d",a[i][j]);
// }
// printf("\n");
//} for(i = 0;i<n;i++){
for(j = 0,k = i-j;j<=i;j++,k--){
b[j][k] = a[i][j];
}
}
for(i = 0;i<n;i++){
flag = 0;
for(j = 0;j<n-i;j++){
if(flag == 0){
printf("%d",b[i][j]);
flag = 1;
}else{
printf(" %d",b[i][j]);
}
}
printf("\n");
}
return 0;
}

E题

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define max 10001
char str[max],substr[20],substr1[20];
int main()
{
//freopen("in.txt","r",stdin);
int len,i,j,wordlen1,len2,now;
while(gets(str)){
now = wordlen1 = 0;
len = strlen(str);
//memset(str,'\0',sizeof(str));
//memset(substr,'\0',sizeof(substr));
for(i = 0,j = 0;i<=len;++i){
if(str[i] == ' '||str[i] == '\0'){
wordlen1 = i-j;
int k;
for(k = 0;k<wordlen1;k++,j++){
substr1[k] = str[j];
}
j = i+1;
if(wordlen1 >now){
memcpy(substr,substr1,wordlen1);
now = wordlen1;
}else if(wordlen1 == now){
if(strcmp(substr1,substr)<0){
memcpy(substr,substr1,wordlen1);
}
}
} }
//for(i = 0;i<now;++i){
// printf("%c",&substr[i]);
//}
printf("%s\n",substr);
for(i = 0;i<len;++i){
str[i] = '\0';
substr[i] = '\0';
}
}
return 0;
//fclose(stdin);
}

F题

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define max 10001
char str[max]; int main()
{
int len,i,judge;
while(scanf("%s",str)!=EOF){
judge = 0;
len = strlen(str);
// printf("%d\n",len);
for(i = 0;i<=len/2;++i){
if(str[i]!=str[len-i-1]){
// printf("%c %c\n",str[i],str[len-i-1]);
judge = 1;
break;
}
}
if(judge){
printf("NO\n");
}else{
printf("YES\n");
}
}
return 0;
}

AOJ. 数组训练.2016-11-17的更多相关文章

  1. 2016/11/17 周四 <javascript的封装简单示例>

    这是一个简单的javascript代码封装的示例以及封装后的调用方法: var ticker={ n:0, add:function() { this.n++; }, show:function() ...

  2. 2016.11.17 NOI plus day0

    今天很乱乱乱乱 根本不想写代码 玩了一早上了 昨晚失眠了 今天又懵逼了 中午就要走了 明天就要考试了 考完试回来就要补文化课了 现在我的内心很平静 因为已经紧张的冻结了 你知道什么叫彷徨么? 机房里的 ...

  3. U3D笔记11:47 2016/11/30-15:15 2016/12/19

    11:47 2016/11/30Before you can load a level you have to add it to the list of levels used in the gam ...

  4. 更新日志(建议升级到2016.12.17) && 更新程序的方法

    更新程序的方法: 1,在控制面板里点击备份当前数据库文件到磁盘,把当天获取的信息从内存写到磁盘/存储卡.2,下载最新版的源码 wget -O "infopi.zip" " ...

  5. 2016.9.17初中部下午NOIP普及组比赛总结

    2016.9.17初中部下午NOIP普及组比赛总结 2016.09.17[初中部 NOIP普及组 ]模拟赛 最近几次的题目都不是自己擅长的啊... 不过含金量挺高的,也好... 进度: 比赛:0+0+ ...

  6. [源码解析] 深度学习分布式训练框架 horovod (17) --- 弹性训练之容错

    [源码解析] 深度学习分布式训练框架 horovod (17) --- 弹性训练之容错 目录 [源码解析] 深度学习分布式训练框架 horovod (17) --- 弹性训练之容错 0x00 摘要 0 ...

  7. 【读书笔记】2016.11.19 北航 《GDG 谷歌开发者大会》整理

    2016.11.19 周六,我们在 北航参加了<GDG 谷歌开发者大会>,在web专场,聆听了谷歌公司的与会专家的技术分享. 中午免费的午餐,下午精美的下午茶,还有精湛的技术,都是我们队谷 ...

  8. 微信iphone7、 ios10播放视频解决方案 2016.11.10

    2016.11.10日更新以下方法 微信最新出同层播放规范 即使是官方的也无法解决所有android手机的问题. 另外iphone 5 .5s 某些手机始终会弹出播放,请继续采用 “以下是老的解决办法 ...

  9. 最新的 cocoapods 安装与使用(2016.11)

    cocoapods简介: cocoapods 是iOS的类库管理工具,可以让开发者很方便集成各种第三方库,而不用去网站上一个个下载,再一个个文件夹的拖进项目中,还得添加相关的系统依赖库.只需要安装好c ...

随机推荐

  1. 感觉总结了一切python常见知识点,可直接运行版本

    #encoding=utf-8#http://python.jobbole.com/85231/#作用域a=1def A(a): a=2 print 'A:',a def B(): print 'B: ...

  2. Http的请求和响应

    请求有客户端发起:可分为4个部分,请求方法(Requestmethod).请求的网址(Request URL).请求头(Request Headers).请求体(Request Body) 1.请求方 ...

  3. 小程序页面的四种文件(JSON、WXML、WXSS、JS)加载顺序

    一个小程序页面由四种文件组成: 1)json 页面配置文件 2)js 页面逻辑文件(必需) 3)wxml 页面结构文件(必需) 4)wxss 页面样式文件 这四个文件的加载顺序: 第一步: 加载页面j ...

  4. leetcode-反转链表

      转载至:https://blog.csdn.net/fx677588/article/details/72357389 反转一个单链表.   示例: 输入: 1->2->3->4 ...

  5. Java学习笔记-11.运行期间类型鉴定

    1.Class对象的getClasses()方法获取的是该类中所有的公共的内部类,以及从父类,父接口继承来的内部类.getinterfaces()方法返回类继承的所有接口. import javax. ...

  6. 线性代数之——对角化和 A 的幂

    利用特征向量的属性,矩阵 \(A\) 可以变成一个对角化矩阵 \(\Lambda\). 1. 对角化 假设一个 \(n×n\) 的矩阵 \(A\) 有 \(n\) 个线性不相关的特征向量 \(x_1, ...

  7. POJ 3084 Panic Room(最大流最小割)

    Description You are the lead programmer for the Securitron 9042, the latest and greatest in home sec ...

  8. HDU 3726 Graph and Queries(平衡二叉树)(2010 Asia Tianjin Regional Contest)

    Description You are given an undirected graph with N vertexes and M edges. Every vertex in this grap ...

  9. iOS- 用UICollectionViewController 来进行横竖屏九宫格布局

    1.简单说说UICollectionViewController 我们在做九宫格布局时,可以使用UIScrollView,也可以使用UICollectionViewController. 当我们用UI ...

  10. jquery.validate 中文乱码解决方法

    第一种.就是所说的引用jquery.validate.messages_cn.js                    下载地址:http://files.cnblogs.com/files/pin ...