# Can You Solve It? 題目連結 [UVA 10642](https://onlinejudge.org/external/106/10642.pdf) ## 中文簡述 輸出走過幾個座標格子 ## solution: ``` #include<bits/stdc++.h> using namespace std; int loc(int x,int y) { return (x+y)*(x+y+1)/2+x; } int main() { int i,j=0,x,y,x2,y2,n,cnt; while(cin>>n) { for(i=0;i<n;i++) { cnt=0; cin>>x>>y>>x2>>y2; cout<<"Case "<<i+1<<": "<<loc(x2,y2)-loc(x,y)<<endl; } } } ``` ###### tags: `UVA` 回目錄 [學習筆記](/gIBZqAbWTCis7uOPp149gA)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up