Solve one and same task using C and C + +