‘cap’ does not name a type

我遇到这个问题是因为我没把程序写到main里面,
忘记、int main(){}