
大家好!我最近买了一本关于Python的教科书。我目前正在使用 Notepad++ 作为编辑器。我正在尝试使用 Powershell 打开我的 ex1.py 文件(位于桌面上)。例如,我尝试使用“python ex1.py”命令在 Powershell 上打开我的文本文件。每次当我尝试使用“cd C:\Desktop”更改工作目录时,我都会收到上述错误。
#include <iostream>
using namespace std;
int main()
{
int grade;
int aCount;
int bCount;
int cCount;
int dCount;
int fCount;
cout << "Enter the letter grades." << endl
<< "Enter the EOF character to end input." << endl;
while ((grade = cin.get()) != EOF)
{
switch (grade)
{
case 'A':
case 'a':
aCount++;
break;
case 'B':
case 'b':
bCount++;
break;
case 'C':
case 'c':
cCount++;
break;
case 'D':
case 'd':
dCount++;
break;
case 'F':
case 'f':
fCount++;
break;
case '\n': …Run Code Online (Sandbox Code Playgroud)