WhiteDouglas 2016-02-08 17:13 采纳率: 50%
浏览 1534

Swift语法错误的问题求大神讲解

import Foundation

let useInput = "To write the code for class , you must provide three chunks or sentions of code"
var OutputCount = 0
for chares in useInput {
switch chares {
case "a","e","i","o","u":
continue
default:
OutputCount++
}
}
print(String(OutputCount))

提示错误:
type string does not conform to protocol sequencetype

请问如何修改呀?
这是书上的源代码呀,难道是Swift语法又修改了?

  • 写回答

2条回答

报告相同问题?

悬赏问题

  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误
  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备