用scanf格式控制不当经常发生此错误。
如
short int a=10; scanf("%d",&a);
应该是%hd;
一般是越界引起的。
参看:http://blog.sciencenet.cn/blog-436197-549687.html