字符串逆序有多种办法,下面我们分方法而论:
//非递归实现字符串反转:
char*reverse(char*str)
{
if(!str)
{
returnNULL;
}
intlen=strlen(str);
inti,j;
chartemp;
for(i=0,j=len-1;i<j;i++,j--)
{
//交换前后两个相应位置的字符
temp=str[i];
str[i]=str[j];
str[j]=..
分类:
编程语言 时间:
2015-11-08 15:26:17
阅读次数:
205
先贴上代码 [HttpPost] public IActionResult ImportTeaching(IFormFile file) { string root = @"Temp/teachingfile/"; strin...
分类:
Web程序 时间:
2015-11-07 14:41:31
阅读次数:
211
#include main() { int i,j,temp; int a[10]; for(i=0;ia[i+1]) { temp=a[i]; a[i]=a[i+1]; a[i+1]=temp;...
分类:
编程语言 时间:
2015-11-06 19:33:35
阅读次数:
200
源程序:#include main() { int i,j,temp; int a[10]; for(i=0;ia[i+1]) { temp=a[i]; a[i]=a[i+1]; a[i+1]=t...
分类:
编程语言 时间:
2015-11-06 19:20:00
阅读次数:
130
#include main() { int i,j,temp; int a[10]; for(i=0;ia[i+1]) { temp=a[i]; a[i]=a[i+1]; ...
分类:
编程语言 时间:
2015-11-06 14:29:04
阅读次数:
118
程序:冒泡算法C程序#include main() { int i,j,temp; int a[10]; for(i=0;ia[i+1]) { temp=a[i]; a[i]=a[i+1]; a[...
分类:
其他好文 时间:
2015-11-06 12:52:16
阅读次数:
192
推测是navicate修改存储过程会自动名为_Navicat_Temp_Stored_Proc的存储过程创建完毕后自动drop由于某些原因或bug导致最终没有drop,于是修改存储过程失败.所以,解决方法很简单DROP PROCEDURE_Navicat_Temp_Stored_Proc即可
分类:
其他好文 时间:
2015-11-05 14:49:27
阅读次数:
3250
第14行,把参数n的绝对值赋给temp,以后在计算各个位的整数时用temp,这样保证在负数情况下取余不会出现问题。第20行,取整数最末尾的数字,+‘0‘是将其转换为字符,第21行,取剩余数字,当执行完while(temp)这个循环,就将该整数的所有位都从右到左的剥离出来,并依此存于buf数..
分类:
其他好文 时间:
2015-11-05 00:46:15
阅读次数:
366
#include using namespace std;void CreatHeap(int a[],int n,int h){ int i,j,flag; int temp; i = h; j = 2*i + 1; temp = a[i]; flag = 0;...
分类:
编程语言 时间:
2015-11-04 13:05:41
阅读次数:
255
declare @temp table ( [id] int IDENTITY(1,1), [Name] varchar(10) ) --select * from @temp declare @tempId int,@tempName varchar(10)insert into ...
分类:
数据库 时间:
2015-11-04 11:19:04
阅读次数:
219