首页 > 其他分享 >tryDiv0

tryDiv0

时间:2023-06-18 15:04:13浏览次数:36  
标签:int try tryDiv0 printf catch main


// tryDiv0.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

int main(int argc, char* argv[])
{
	int i,j,k;
	i=1;
	j=0;
	try
	{
		k=i/j;
	}
	catch(...)
	{
		printf("in catch!\n");
	}
	printf("k=%f\n",k);
	return 0;
}
/*
in catch!
k=0.000000
*/



标签:int,try,tryDiv0,printf,catch,main
From: https://blog.51cto.com/gjwrxz/6508412

相关文章