//
// main.m
// stringTest
//
// Created by wen jing on 12-8-4.
// Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
@autoreleasepool {
int sum = 0;
for (int i=1; i<10; i++) {
sum+=i;
if (i==5) {
goto MyJump;
}
}
NSLog(@"1-9 sum=%i",sum);
MyJump:
NSLog(@"1-5 sum=%i",sum);
}
return 0;
}
循环语句if语句goto的综合应用
最新推荐文章于 2021-05-29 08:26:39 发布