#include#includeusing namespace std;int main(){ int kp = 0; for(int i = 1000; i < 10000; i++) { int B = 1, K = sqrt(i), d = 2; while(d <= K) { if (i % d++ == 0) { B = 0; break; } } if (B) { int S = (i % 10)+((i/10)%10); if (S == ((i/100)%10)+(i/1000)) { cout <<i<<'('<<S<<')'<<(S<10?" ":"")<<" "; if (++kp % 5 == 0) cout <<"\n"; } } } return 0;}