//
// main.m
//
// Created by mac on 4/27/16.
// Copyright © 2016 mac. All rights reserved.
//
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
//
char str1[100];
char str2[100];
//
printf("请输入一个字符串:\n");
gets(str1);
//
unsigned long len1 = strlen(str1);
//
for (int i = 0 ,j = (int)len1 - 1; i < len1; i++,j--) {
str2[j] = str1[i];
}
//
puts(str2);
return 0;
} |
|