foo.cpp: In function 'void floyd()':
foo.cpp:108:23: warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations]
mp[i][j]=min(mp[i][j],mp[i][k]+mp[k][j]);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cpp:107:25: note: within this loop
for(int j=1;j<=3;j++)
~^~~
foo.cpp:104:24: warning: array subscript is above array bounds [-Warray-bounds]
mp[1][2]=a;mp[2][3]=b;
~~~~~~~^
foo.cpp:109:20: warning: array subscript is above array bounds [-Warray-bounds]
ans[3]=mp[1][3];
~~~~~~~^