各个语言基本输入输出,java,c,c++,c#,python,php,javascript
java
//输入一组数据并输出
Scanner sc = new Scanner(System.in);
String str=sc.nextLine();
System.out.printf("%s\n",str);
//输入多组数据并输出
Scanner sc = new Scanner(System.in);
String str;
while(sc.hasNextLine()){
str = sc.nextLine();
System.out.printf("%s\n",str);
}
c
//输入一组数据并输出
int a,b;
scanf("%d %d”,&a,&b);
printf("%d %d\n”,a,b);
//输入多组数据并输出
int a[100],b[100],i;
while(scanf("%d %d",&a[i],&b[i])!=EOF)
{
printf("%d %d\n",a[i],b[i]);
i++;
}
c++
//输入一组数据并输出
int a, b;
cin>> a >> b;
cout << a << b << endl;
//输入多组数据并输出
int a, b;
while(cin>> a >> b)
cout << a << b << endl;
c#
//输入一组数据并输出
string str= Console.ReadLine()
Console.WriteLine(str);
//输入多组数据并输出
string str;
while((str=Console.ReadLine())!=null)
Console.WriteLine(str);
python
//输入一组数据并输出
str=raw_input()
print str
//输入多组数据并输出
import sys
for line in sys.stdin:
for value in line.split():
print(value)
php
/输入一组数据并输出
$str=fgets(STDIN,1000);
echo $str;
//输入多组数据并输出
$s = fgets(STDIN,1000);
while ($s != "") {
print ($s);
$s = fgets(STDIN,1000);
}
javascript
//输入一组数据并输出
function main(a1,a2,a3,a4,a5,a6){
console.log(a1,a2,a3,a4,a5,a6);
}