C++到C!!

来源:百度知道 编辑:UC知道 时间:2024/07/04 16:01:51
能帮我把这个弄成c的吗?

#include<iostream.h>
#include <stdlib.h>
#include<conio.h>
#include<string.h>

void main()
{
int i,j;
char buffer[20];
cout <<"请输入密码:"<<endl;
for (i=0;i<3;i++)
{
j=0;
while((buffer[j]=getch())!='\r')
{
if(buffer[j]==8)
{
j--;
if(j<0) j=0; putch('\b');
putch(' '); putch('\b');
}
else
{
j++; putch('*');
}
}
buffer[j]='\0';
if(strcmp(buffer,"1")==0)
{
cout<<"\n 欢迎进入系统!"<<endl;

#include<stdio.h>
#include <stdlib.h>
#include<string.h>
#include<conio.h>
void main()
{
int i,j;
char buffer[20];

printf( "Please enter the secret code :");

for (i=0;i<3;i++)
{
j=0;
while((buffer[j]=getch())!='\r')
{
if(buffer[j]==8)
{
j--;
if(j<0)
j=0;
putch('\b');
putch(' ');
putch('\b');
}
else
{
j++;
putch('*');
}
}
buffer[j]='\0';
if(strcmp(buffer,"1")==0)
{
printf("\n welcome to system!!\n");
break;
}
else
{
printf("\n");
printf("Please enter the secret code again:");
}
}

}

#include <stdlib.h>