![](/img/trans.png)
[英]Executable “C:\Windows\System32\Fodhelper.exe” not found
[英]The terminal process "C:\WINDOWS\System32\cmd.exe" terminated with exit code: 1
在使用Visual Studio Code計算數組中 Leaders的總和時,我遇到了一個錯誤: “終端進程“C:\WINDOWS\System32\cmd.exe”終止,退出代碼:1。”
我的 C++ 實現如下:
#include<bits/stdc++.h>
using namespace std;
int leader_func(int arr[], int n)
{
int sum=0;
int max=arr[n-1];
for (int i = n-2; i>=0; i--)
{
if (max<arr[i])
{
sum+=arr[i];
}
}
return sum;
}
int main()
{
int arr[4]={33,7,21,14};
int n=4;
cout<<leader_func(arr, n);
return 0;
}
預期的 output 為: 54
(即 33 + 21)。
我收到的實際結果: The terminal process "C:\WINDOWS\System32\cmd.exe" terminated with exit code: 1.
可能的原因是什么? 如何解決這個問題?
更改項目文件 -> 設置 -> 構建后設置 -> 添加 \ (在末尾)到 xcopy 消息
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.