[求助]好像是C#输入有点问题。
using System;
public struct Distance { int longitude; int latitude; public Distance(int lon,int mag) { longitude=lon; latitude=mag; } public static Distance operator -(Distance first,Distance secend) { return new Distance(first.longitude - secend.longitude , first.latitude - secend.latitude); }
public static void Main() { Distance start=new Distance(); Distance finish=new Distance(); Distance newDistance=new Distance(); start.longitude=12; start.latitude=10; finish.longitude=2; finish.latitude=1; newDistance=start-finish; Console.WriteLine(newDistance.longitude,newDistance.latitude);
} }
帮小弟我看看,为什么错了,谢谢大哥,大姐。