xxxxxxxxxx
int GetTribePoints(int Tribe_Id) override
{
int TribePoints;
try
{
TribeDatabase << "SELECT TribePoints FROM TribePoints WHERE TribeId = ?;" << Tribe_Id >> TribePoints;
return TribePoints;
}
catch (const sqlite::sqlite_exception& exception)
{
Log::GetLog()->error("({} {}) Unexpected DB error 10{}", __FILE__, __FUNCTION__, exception.what());
}
}
bool SetTribePoints(int Tribe_Id, int TribePoints) override
{
try
{
TribeDatabase << "UPDATE TribePoints SET TribePoints = ? WHERE TribeId = ?;" << TribePoints << Tribe_Id;
return true;
}
catch (const sqlite::sqlite_exception& exception)
{
Log::GetLog()->error("({} {}) Unexpected DB error 11{}", __FILE__, __FUNCTION__, exception.what());
return false;
}
}
xxxxxxxxxx
#include <iostream>
///Matrice cu n linii si m coloane.Calculeaza si afiseaza cate numere pozitive sunt pe fiecare linie
using namespace std;
int main()
{
int a[100][100],i,j,n,m,nr_poz;
cin>>n>>m;
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
cin>>a[i][j];
for(i=1; i<=n; i++)
{
nr_poz=0;
for(j=1; j<=m; j++)
{
if(a[i][j]>0)
{
nr_poz++;
}
} a[i][m+1]=nr_poz;
for(i=1;i<=n;i++)
{
for(j=1;j<=m;j++)
cout<<nr_poz<<" ";}
}
return 0;
}