# 网易2019届秋招内推笔试编程题题解

``````#include iostream
#include cstdio
#include cmath
#include cstring
#include cstdlib
#include algorithm
#define LL long long
using namespace std;
LL m ,n;
LL item[1000];
LL cnt;
int yinshufenjie(LL num){
cnt =0;
LL i;
LL temp = num;
do{
temp=num;
for (i = 9;i =2 ;i--)
{
while (num != i)
{
if (num%i == 0)
{
item[cnt++] = i;
num = num / i;
}
else break;
}

}
}while(temp != num);

if(num10){
item[cnt++]=num;
return 1;
}
else{
return 0;
}
}
int main()
{
LL m ,n;
cinn;
if(yinshufenjie(n)){
sort(item,item+cnt);
for(int i=0;icnt;i++){
coutitem[i];
}
coutendl;
}
else{
cout"0"endl;
}
return 0;
}
``````

``````#include iostream
#include cstdio
#include cmath
#include cstring
#include cstdlib
#define LL long long
using namespace std;
int main(){
int t;
char s[101];
char ntes[10]="NTES\0";
int len = strlen(ntes);
cint;
while(t--){
cins;
int cnt =0;
int l = strlen(s);
for(int i=0;il;i++){
if(s[i]==ntes[cnt]){
cnt++;
}
if(cntlen){
break;
}
}
//coutcntendl;
if(cnt == len){
cout"yes"endl;
}
else{
cout"no"endl;
}
}
return 0;
}
/*
2
STNETEDTS
TSENSTE
*/
``````

``````#include iostream
#include cstdio
#include cmath
#include cstring
#include cstdlib
#define LL long long
using namespace std;
struct node{
int left;
int right;
}tree[101];
int main(){
int n;
cinn;
int father[101];
int left,right;
int cp=1;
int nextp=0;
int dep = 1;
for(int i=0;in;i++){
cp--;
cinleftright;
if(left0){
nextp+=1;
}
if(right0){
nextp+=1;
}
if(cp==0){
cp=nextp;
if(cp0){
dep+=1;
}
nextp=0;
}
}
coutdependl;
return 0;
}
``````