以下是程序设计导论中伪代码的各个语言实现的代码。
C
文件名:shishiqiushi1_1.c
#include<stdio.h>
int main(){
char str[20];
scanf("%s",str);
printf("%s",str);
return 0;
}
文件名:shishiqiushi1_2.c
#include<stdio.h>
int main(){
int n;
scanf("%d",&n);
char str[20];
for(int i = 0; i < n; i++){
scanf("%s",str);
printf("%s",str);
}
return 0;
}
C++
文件名:shishiqiushi1_1.cpp
#include<iostream>
using namespace std;
int main(){
char str[20];
cin>>str;
cout<<str<<endl;
}
文件名:shishiqiushi1_2.cpp
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
char str[20];
for(int i = 0; i < n; i++){
cin>>str;