DATE 11

数组逆序输出

输入数组,逆序输出

#include<stdio.h>
#include<string.h>


#define N 100 //宏定义数组的长度


int main()
{
int i; //定义循环变量
int temp; //定义一个中间数,用来存放数据
int n; //定义变量,表示数组的长度


int nums[N]; //定义一个数组

printf("Please input length_nums:\n"); //显示提示信息
    scanf("%d",&n); //输入数组长度

printf("Please input nums:\n"); //显示提示信息

for(i = 0;i < n;i++) //循环输入数组的元素
{
scanf("%d",&nums[i]);
}


for(i = 0;i < n / 2;i++) //循环替换数组内的数据
{
temp = nums[i]; //将nums[i]与nums[n - 1 - i]互换
nums[i] = nums[n - 1 - i];
nums[n - 1 - i] = temp;
}


for(i = 0;i < n;i++)
{
printf("reverse_array = %d\n",nums[i]); //循环输出结果
}


return 0;
}



你的方法是最简便的方法吗? 我的表的字段有:loan_bill_no loan_type instal_terms cur_terms unique_id prod_cd loan_date cleared_date dpd max_dpd loan_status trans_term 1st_repayable_date 1st_cleared_date 1st_dpd 2nd_repayable_date 2nd_cleared_date 2nd_dpd 3rd_repayable_date 3rd_cleared_date 3rd_dpd 4th_repayable_date 4th_cleared_date 4th_dpd 5th_repayable_date 5th_cleared_date 5th_dpd 6th_repayable_date 6th_cleared_date 6th_dpd 7th_repayable_date 7th_cleared_date 7th_dpd 8th_repayable_date 8th_cleared_date 8th_dpd 9th_repayable_date 9th_cleared_date 9th_dpd 10th_repayable_date 10th_cleared_date 10th_dpd 11th_repayable_date 11th_cleared_date 11th_dpd 12th_repayable_date 12th_cleared_date 12th_dpd 13th_repayable_date 13th_cleared_date 13th_dpd 14th_repayable_date 14th_cleared_date 14th_dpd 15th_repayable_date 15th_cleared_date 15th_dpd 16th_repayable_date 16th_cleared_date 16th_dpd 17th_repayable_date 17th_cleared_date 17th_dpd 18th_repayable_date 18th_cleared_date 18th_dpd 19th_repayable_date 19th_cleared_date 19th_dpd 20th_repayable_date 20th_cleared_date 20th_dpd 21th_repayable_date 21th_cleared_date 21th_dpd 22th_repayable_date 22th_cleared_date 22th_dpd 23th_repayable_date 23th_cleared_date 23th_dpd 24th_repayable_date 24th_cleared_date 24th_dpd 25th_repayable_date 25th_cleared_date 25th_dpd 26th_repayable_date 26th_cleared_date 26th_dpd 27th_repayable_date 27th_cleared_date 27th_dpd 28th_repayable_date 28th_cleared_date 28th_dpd 29th_repayable_date 29th_cleared_date 29th_dpd 30th_repayable_date 30th_cleared_date 30th_dpd 31th_repayable_date 31th_cleared_date 31th_dpd 32th_repayable_date 32th_cleared_date 32th_dpd 33th_repayable_date 33th_cleared_date 33th_dpd 34th_repayable_date 34th_cleared_date 34th_dpd 35th_repayable_date 35th_cleared_date 35th_dpd 36th_repayable_date 36th_cleared_date 36th_dpd 37th_repayable_date 37th_cleared_date 37th_dpd 38th_repayable_date 38th_cleared_date 38th_dpd 39th_repayable_date 39th_cleared_date 39th_dpd 40th_repayable_date 40th_cleared_date 40th_dpd 41th_repayable_date 41th_cleared_date 41th_dpd 42th_repayable_date 42th_cleared_date 42th_dpd 43th_repayable_date 43th_cleared_date 43th_dpd 44th_repayable_date 44th_cleared_date 44th_dpd 45th_repayable_date 45th_cleared_date 45th_dpd 46th_repayable_date 46th_cleared_date 46th_dpd 47th_repayable_date 47th_cleared_date 47th_dpd 48th_repayable_date 48th_cleared_date 48th_dpd 49th_repayable_date 49th_cleared_date 49th_dpd 50th_repayable_date 50th_cleared_date 50th_dpd 51th_repayable_date 51th_cleared_date 51th_dpd 52th_repayable_date 52th_cleared_date 52th_dpd 53th_repayable_date 53th_cleared_date 53th_dpd 54th_repayable_date 54th_cleared_date 54th_dpd 55th_repayable_date 55th_cleared_date 55th_dpd 56th_repayable_date 56th_cleared_date 56th_dpd 57th_repayable_date 57th_cleared_date 57th_dpd 58th_repayable_date 58th_cleared_date 58th_dpd 59th_repayable_date 59th_cleared_date 59th_dpd 60th_repayable_date 60th_cleared_date 60th_dpd etl_time etl_source contr_no master_contr_no master_child_contr_flag ovd_begin_date repayable_prin repay_match_prin_amt ovd_prin spl_prin trade_amt mob req_time dt
最新发布
07-30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值