Namespace: System.Windows.Forms MessageBox public static DialogResult Show( string text ) - только сам текст сообщения Например MessageBox.Show("Hello, world.");
Есть много перегрузок у метода Show Show(String, String) - текст и заголовок Show(String, String, MessageBoxButtons) - текст и заголовок и кнопки Show(String, String, MessageBoxButtons, MessageBoxIcon) - плюс иконка окна сообщения Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton) - плюс выбрана кнопка по умолчанию И еще и еще. Смотрите справку на сайте MSDN
Пример с иконкой MessageBox.Show("Typical installation is strongly recommended.", "Install information", MessageBoxButtons.OK, MessageBoxIcon.Information);
1)var a:array [1..10] of integer; i,sum:integer;begin randomize; sum:=0; for i:=1 to 10 do begin a[i]:=random(100)-50; write (a[i],' '); if a[i] < 0 then sum:=sum+a[i]; end; writeln; writeln ('Summa: ',sum); readln;end. 2)var a:array [1..10] of integer; i,max,index:integer;begin for i:=1 to 10 do begin write ('A[',i,'] = '); readln (a[i]); end; max:=a[1]; index:=1; for i:=2 to 10 do if a[i] > max then begin max:=a[i]; index:=i; end; writeln ('Max: ',max,'.Index: ',index); readln;end. 3)var a:array [1..10] of integer; max,min,i,temp:integer;begin randomize; for i:=1 to 10 do begin a[i]:=random(50); write (a[i],' '); end; writeln; max:=1; min:=1; for i:=2 to 10 do if a[i] > a[max] then max:=i else if a[i] < min then min:=i; writeln ('Max: ',a[max]); writeln ('Min: ',a[min]); temp:=a[min]; a[min]:=a[max]; a[max]:=temp; for i:=1 to 10 do write (a[i],' ');end.Не знаю- правильно ли?
#include <iostream>
#include <ctime>
#include <iomanip>
#include <vector>
using namespace std;
typedef vector< vector<int> > T;
ostream &operator<<(ostream &output,const T &mass)
{
for(size_t i = 0;i<mass.size();++i){
for(size_t j = 0;j<mass.size();++j)
output<<setw(5)<<mass[j];
output<<"\n\n";
}
return output;
}
int _tmain(int argc, _TCHAR* argv[])
{
srand((unsigned)time(0));
unsigned int row,col;
do{
cout<<"Enter rows > 0"<<endl;
cin>>row;
}while(row <= 0);
do{
cout<<"Enter col > 0"<<endl;
cin>>col;
}while(col <= 0);
T mass(row, vector<int>(col));
for(size_t i = 0;i < row;++i){
for(size_t j = 0;j < col;++j)
mass[j] = rand()%10;
}
cout<<mass;
return 0;
}