#include<stdio.h>
int main(){
int a,b,c;
while(scanf("%d %d %d",&a,&b,&c)!=EOF){
getchar();
if((a+b)>c&&(a+c)>b&&(b+c)>a){
if(a==b&&b==c)printf("Equilateral triangle!\n");//不能连等
else if(a==b||a==c||b==c)printf("Isosceles triangle!\n");
else printf("Ordinary triangle!\n");
}
else printf("Not a triangle!\n");
}
}
c++:
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
while(cin>>a>>b>>c){
if((a+b)>c&&(a+c)>b&&(b+c)>a){
if(a==b&&b==c)cout<<"Equilateral triangle!";
else if(a==b||a==c||b==c)cout<<"Isosceles triangle!";
else cout<<"Ordinary triangle!";
}
else cout<<"Not a triangle!";
cout<<endl;//endl可以放后面。
}
}
Java:
import java.io.*;
public class Main{
public static void main(String[]args)throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String s;
while((s=br.readLine())!=null){
String[] sa=s.split(" ");
int a=Integer.parseInt(sa[0]);
int b=Integer.parseInt(sa[1]);
int c=Integer.parseInt(sa[2]);
if((a+b)>c&&(a+c)>b&&(b+c)>a){
if(a==b&&b==c)
System.out.println("Equilateral triangle!");
else if(a==b||b==c||a==c)
System.out.println("Isosceles triangle!");
else
System.out.println("Ordinary triangle!");
}
else
System.out.println("Not a triangle!");
}
}
}