排队(wrong???

This commit is contained in:
James 2020-03-28 09:40:16 +08:00
parent 4711b88b92
commit 5e2f7f9cf7
12 changed files with 69 additions and 0 deletions

3
4062_dui/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

3
4062_dui/doc/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 1 3 3 4 2

Binary file not shown.

27
4062_dui/dui.cpp Normal file
View File

@ -0,0 +1,27 @@
#include<iostream>
using namespace std;
int main(){
int n,a[1001]={0},f[1001]={0};
int pan=0;
cin>>n;
for(int i=1;i<n;i++){
cin>>a[i];
}
for(int i=a[1]-1;i>0;i--){
f[1]=i;
for(int j=2;j<=n;j++){
if(a[j-1]-f[j-1]>0){
f[j]=a[j-1]-f[j-1];
pan=j;
}else{
break;
}
}
if(pan==n){
for(int j=1;j<=n;j++){
cout<<f[j]<<" ";
}
return 0;
}
}
}

BIN
4062_dui/dui.exe Normal file

Binary file not shown.

6
4062_dui/main.cpp Normal file
View File

@ -0,0 +1,6 @@
#include <iostream>
int main()
{
std::cout << "Hello Easy C++ project!" << std::endl;
}

BIN
4062_dui/main.exe Normal file

Binary file not shown.

View File

@ -0,0 +1,2 @@
5
4 6 7 6

View File

@ -0,0 +1,2 @@
6
6 5 4 7 11

View File

@ -0,0 +1,2 @@
7
11 7 4 7 6 9

0
4062_dui/test/in.txt Normal file
View File

24
4062_dui/test/out.txt Normal file
View File

@ -0,0 +1,24 @@
## z:\Chao\src\4062_dui\test\in.txt
2020/03/28 ÖÜÁù 9:35:42.10
-----------------------------------------------
Process exited after 140 ms with return value 0
## z:\Chao\src\4062_dui\test\In0 (6).txt
2020/03/28 ÖÜÁù 9:35:42.10
3 1 5 2 4
-----------------------------------------------
Process exited after 130 ms with return value 0
## z:\Chao\src\4062_dui\test\In1 (9).txt
2020/03/28 ÖÜÁù 9:35:42.10
4 2 3 1 6 5
-----------------------------------------------
Process exited after 100 ms with return value 0
## z:\Chao\src\4062_dui\test\In2 (1).txt
2020/03/28 ÖÜÁù 9:35:42.10
6 5 2 2 5 1 8
-----------------------------------------------
Process exited after 80 ms with return value 0