代码如下
#include<stdio.h>
int main(){
int n,m;
scanf("%d %d",&n,&m);
int temp=0,ans=0;
for(int x1=0;x1<n;x1++){
for(int y1=0;y1<m;y1++){
for(int x2=0;x2<=n;x2++){
for(int y2=0;y2<=m;y2++){
if(x2>x1&&y2>y1){
if((x2-x1)==(y2-y1)){
temp++;
}
else ans++;
}
}
}
}
}
printf("%d ",temp);
printf("%d",ans);
return 0;}