Example #1
3
// -------------------------------------------------------------------
void
DPRegression::SetDisplays(BMessage* theMesg)
{
	record_key theKey;
	theMesg->FindInt64(disp_set_name,&theKey);
	for(int32 setNum = 0; setNum < NumSets(); setNum++) {
		DRRegrData* theRData = (DRRegrData*)DisplayData(setNum);
		if(theRData != NULL) {
			const DPData* theData = theRData->Data();
			if(theKey == theData->Key()) {
				int16 val = theMesg->FindInt16(disp_mark_name);
				int16 lVal = theMesg->FindInt16(disp_line_name);
				theRData->SetPlotMark((EPlotMark)val);
				theRData->SetDataColor(::ValueToColor(theMesg->FindInt32(mark_col_name)));
				theRData->SetLineType((ERegrLineType)lVal);
				mRegrWindow->ReDraw();
				return;	// *** EXIT HERE if found
			}
		}
	}
}	
Example #2
-1
void main()
{
    freopen("NumberSet.in", "r", stdin);
    freopen("NumberSet.out", "w", stdout);

    int N;
    scanf(" %d", &N);
    for (int i = 1; i <= N; ++i)
    {
        ll A, B, P;
        scanf(" %lld %lld %lld", &A, &B, &P);
		
        ll numSets = NumSets(A, B, P);
        printf("%d: %lld\n", i, numSets);
    }
}