我的理解是获取输入:
int num = 0;
NSLog (@"Input 5 numbers");
scanf("%d", &num);
NSLog (@"\n You inputted: %d !", num);
样本输入:54321 输出:54321
但输出应该是:
5
4
3
2
1
答案 0 :(得分:0)
我在这里看不到任何一行代码解决方案。可以使用for
或while
循环来实现。例如你可以将num除以10或将其转换为字符串并获取每个字符。
有关将NSString转换为char数组see here的示例。